Skip to content

Commit

Permalink
Fix formating of internal urls in docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mwydmuch committed Dec 15, 2023
1 parent d931641 commit 926d99a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion scripts/create_python_docstrings_from_cpp_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def camel_case_to_snake_case(text):
r"\[([a-zA-Z/_\(\):\-\. \(\)]+)?\]\((.*)?\)",
r"`\1 <\2>`_",
), # MD links -> RT links
(r"\.md([#a-zA-Z\-]*)>`_", r".html\1>`_"), # Fix links ending with .md
(r"\.md([#a-zA-Z\-]*)>`_", r"/\1>`_"), # Fix links ending with .md
(
r"^See also:.*$",
"See also:\n",
Expand Down
20 changes: 10 additions & 10 deletions src/lib_python/ViZDoomMethodsDocstrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Then the rest of the players must also call this method to start a new episode.
Note: Changed in 1.1.0)DOCSTRING";

const char *replayEpisode = R"DOCSTRING(Replays the recorded episode from the given file using the perspective of the specified player.
Players are numbered from 1, If ``player`` argument is equal to 0,
Players are numbered from 1, If ``player`` argument is equal to 0,
the episode will be replayed using the perspective of the default player in the recording file.
After calling this method, the first state from the replay will be available.
All rewards, variables, and states are available when replaying the episode.
Expand Down Expand Up @@ -78,7 +78,7 @@ updates the state and calculates a new reward, which is returned.)DOCSTRING";
const char *isNewEpisode = R"DOCSTRING(Returns ``True`` if the current episode is in the initial state - the first state, no actions were performed yet.)DOCSTRING";

const char *isEpisodeFinished = R"DOCSTRING(Returns ``True`` if the current episode is in the terminal state (is finished).
:meth:`make_action` and :meth:`advance_action` methods
:meth:`make_action` and :meth:`advance_action` methods
will take no effect after this point (unless :meth:`new_episode` method is called).)DOCSTRING";

const char *isPlayerDead = R"DOCSTRING(Returns ``True`` if the player is dead.
Expand Down Expand Up @@ -111,7 +111,7 @@ Note: Changed in 1.1.0)DOCSTRING";
Note: added in 1.1.6.)DOCSTRING";

const char *getLastAction = R"DOCSTRING(Returns the last action performed.
Each value corresponds to a button added with :meth:`set_available_buttons`
Each value corresponds to a button added with :meth:`set_available_buttons`
or/and :meth:`add_available_button` (in order of appearance).
Most useful in ``SPECTATOR`` mode.)DOCSTRING";

Expand Down Expand Up @@ -139,7 +139,7 @@ Config key: ``availableButtons``/``available_buttons`` (list of values)
See also:
- `Configuration files: List of values <../configurationFiles.html#list-of-values>`_)DOCSTRING";
- `Configuration files: List of values <../configurationFiles/#list-of-values>`_)DOCSTRING";

const char *addAvailableButton = R"DOCSTRING(Adds :class:`.Button` type (e.g. ``TURN_LEFT``, ``MOVE_FORWARD``) to available buttons and sets the maximum allowed, absolute value for the specified button.
If the given button has already been added, it will not be added again, but the maximum value will be overridden.
Expand All @@ -150,7 +150,7 @@ Config key: ``availableButtons``/``available_buttons`` (list of values)
See also:
- `Configuration files: List of values <../configurationFiles.html#list-of-values>`_)DOCSTRING";
- `Configuration files: List of values <../configurationFiles/#list-of-values>`_)DOCSTRING";

const char *clearAvailableButtons = R"DOCSTRING(Clears all available :class:`.Button`s added so far.
Expand Down Expand Up @@ -180,7 +180,7 @@ Config key: ``availableGameVariables``/``available_game_variables`` (list of val
See also:
- `Configuration files: List of values <../configurationFiles.html#list-of-values>`_)DOCSTRING";
- `Configuration files: List of values <../configurationFiles/#list-of-values>`_)DOCSTRING";

const char *addAvailableGameVariable = R"DOCSTRING(Adds the specified :class:`.GameVariable` to the list of available game variables (e.g. ``HEALTH``, ``AMMO1``, ``ATTACK_READY``) in the :class:`.GameState` returned by :meth:`get_state` method.
Expand All @@ -190,22 +190,22 @@ Config key: ``availableGameVariables``/``available_game_variables`` (list of val
See also:
- `Configuration files: List of values <../configurationFiles.html#list-of-values>`_)DOCSTRING";
- `Configuration files: List of values <../configurationFiles/#list-of-values>`_)DOCSTRING";

const char *clearAvailableGameVariables = R"DOCSTRING(Clears the list of available :class:`.GameVariable` s that are included in the :class:`.GameState` returned by :meth:`get_state` method.
Has no effect when the game is running.
See also:
- `Configuration files: List of values <../configurationFiles.html#list-of-values>`_)DOCSTRING";
- `Configuration files: List of values <../configurationFiles/#list-of-values>`_)DOCSTRING";

const char *getAvailableGameVariablesSize = R"DOCSTRING(Returns the number of available :class:`.GameVariable`.
It corresponds to taking the size of the list returned by :meth:`get_available_game_variables`.
See also:
- `Configuration files: List of values <../configurationFiles.html#list-of-values>`_)DOCSTRING";
- `Configuration files: List of values <../configurationFiles/#list-of-values>`_)DOCSTRING";

const char *getGameVariable = R"DOCSTRING(Returns the current value of the specified :class:`.GameVariable` (``HEALTH``, ``AMMO1`` etc.).
The specified game variable does not need to be among available game variables (included in the state).
Expand Down Expand Up @@ -272,7 +272,7 @@ If the file relative path is given, it will be searched for in the following ord
See also:
- `Configuration files <../configurationFiles.html>`_)DOCSTRING";
- `Configuration files <../configurationFiles/>`_)DOCSTRING";

const char *getMode = R"DOCSTRING(Returns the current :class:`.Mode` (``PLAYER``, ``SPECTATOR``, ``ASYNC_PLAYER``, ``ASYNC_SPECTATOR``).)DOCSTRING";

Expand Down

0 comments on commit 926d99a

Please sign in to comment.