Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python syntax highlighting to README.rst #395

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

Benjamin-Loison
Copy link
Contributor

Verified exhaustiveness with:

find -name '*.rst'

Verified exhaustiveness with:

```bash
find -name '*.rst'
```
Copy link
Collaborator

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for an easy review! And the improvements. :] What do you think of using python-console for those blocks as in the suggestions?


.. code-block:: python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: python
.. code-block:: python-console

@@ -325,6 +332,8 @@ REPORTING
The output can be redirected to a log file by passing IO stream as
parameter to the decorator like @profile(stream=fp)

.. code-block:: python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: python
.. code-block:: python-console

@@ -343,6 +352,8 @@ when we need to use RotatingFileHandler.
The output can be redirected to logger module by simply making use of
LogFile of memory profiler module.

.. code-block:: python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: python
.. code-block:: python-console

@@ -354,11 +365,13 @@ could be cumbersome and one can choose only entries with increments
by passing True to reportIncrementFlag, where reportIncrementFlag is
a parameter to LogFile class of memory profiler module.

.. code-block:: python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: python
.. code-block:: python-console

@@ -441,6 +466,8 @@ Currently, the backend can be set via the CLI

and is exposed by the API

.. code-block:: python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: python
.. code-block:: python-console

@@ -282,6 +287,7 @@ necessarily a Python program), a string containing some python code to
be evaluated or a tuple ``(f, args, kw)`` containing a function and its
arguments to be evaluated as ``f(*args, **kw)``. For example,

.. code-block:: python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. code-block:: python
.. code-block:: python-console

@Benjamin-Loison
Copy link
Contributor Author

Benjamin-Loison commented Oct 22, 2023

Thank you for suggesting using Python console syntax highlighting, I like the idea of using it to be more precise. However, as this code snippet shows in the Preview tab, it has a syntax highlighting for the indented code (by precising Python syntax highlighting), but not when using Python console syntax highlighting. Without even talking about the rendering in the Code tab which doesn't work at all for Python console syntax highlighting.

So Python console GitHub syntax highlighting rendering doesn't seem perfect yet, hence I don't have any strong opinion and I let you choose the one you prefer.

Copy link
Collaborator

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always something, isn't it... Oh well.

@altendky altendky merged commit a99a3c3 into pythonprofilers:master Oct 23, 2023
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants