Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 16, 2022. It is now read-only.

use default highlight language if none was given #24

Merged

Conversation

xabbuh
Copy link
Contributor

@xabbuh xabbuh commented Oct 21, 2014

When using the literalinclude directive inside a configuration
block, it's a tedious task to always pass the language used to
highlight the included code file like this:

.. configuration-block::

    .. literalinclude:: /foo.php
        :language: php

Now, you can omit the language to let the file being rendered with
the language configured by the highlight_language option:

.. configuration-block::

    .. literalinclude:: /foo.php

This way, a literalinclude directive used inside a configuration
block works in the same manner as outside of it.

When using the `literalinclude` directive inside a configuration
block, it's a tedious task to always pass the language used to
highlight the included code file like this:

```
.. configuration-block::

    .. literalinclude:: /foo.php
        :language: php
```

Now, you can omit the `language` to let the file being rendered with
the language configured by the `highlight_language` option:

```
.. configuration-block::

    .. literalinclude:: /foo.php
```

This way, a `literalinclude` directive used inside a configuration
block works in the same manner as outside of it.
@fabpot
Copy link
Owner

fabpot commented Oct 22, 2014

Thank you @xabbuh.

@fabpot fabpot merged commit 42e9c7e into fabpot:master Oct 22, 2014
fabpot added a commit that referenced this pull request Oct 22, 2014
This PR was merged into the 1.0-dev branch.

Discussion
----------

use default highlight language if none was given

When using the `literalinclude` directive inside a configuration
block, it's a tedious task to always pass the language used to
highlight the included code file like this:

```
.. configuration-block::

    .. literalinclude:: /foo.php
        :language: php
```

Now, you can omit the `language` to let the file being rendered with
the language configured by the `highlight_language` option:

```
.. configuration-block::

    .. literalinclude:: /foo.php
```

This way, a `literalinclude` directive used inside a configuration
block works in the same manner as outside of it.

Commits
-------

42e9c7e use default highlight language if none was given
@xabbuh xabbuh deleted the default-highlight-language-in-configuration-block branch October 22, 2014 07:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants