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 code snippet features to match features from sphinx literalinclude directive #189

Closed
danroth27 opened this issue Mar 4, 2016 · 1 comment
Assignees
Milestone

Comments

@danroth27
Copy link
Member

When using Sphinx to build documentation you can use the literalinclude directive to include code snippets from a separate file. DocFX flavored markdown supports something similar with code snippets, but it looks like it is missing a few features that we use heavily in the ASP.NET docs:

  • Ability to specify multiple line number ranges and to skip lines:
.. literalinclude:: example.py
   :lines: 1,3,5-10,20-
  • Options to display line numbers when the code is rendered and to emphasize specific lines when the code rendered:
.. literalinclude:: example.rb
   :language: ruby
   :emphasize-lines: 12,15-18
   :linenos:
  • Ability to dedent the rendered code so that it is correctly aligned with the rest of the content instead of having extra leading whitespace:
.. literalinclude:: example.rb
   :language: ruby
   :dedent: 4
   :lines: 10-15
@superyyrrzz
Copy link
Contributor

Support highlight lines in code snippet in 27e88f3

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

No branches or pull requests

3 participants