The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,514 other followers

Archive for the ‘reStructuredText’ Category

Converting html fragments to reStructuredText

Posted by jpluimers on 2019/01/09

Though normally you would write documentation in reStructuredText, then generate HTML or PDF, often you find a part of the documentation source in HTML.

Here are some sites and tools I’ve used to convert HTML fragments to reStructuredText. I favour on-line over local command-line tools as usually these kinds of conversions are “one-time only”.

–jeroen

Posted in Development, Lightweight markup language, reStructuredText, Software Development | Leave a Comment »

Inline images in reStructuredText

Posted by jpluimers on 2018/11/14

Source: reStructuredText Directives – Images:

Inline images can be defined with an “image” directive in a substitution definition.

The |biohazard| symbol must be used on containers used to
dispose of medical waste.

.. |biohazard| image:: biohazard.png

–jeroen

Posted in Development, Lightweight markup language, reStructuredText, Software Development | Leave a Comment »

Finding out why Github doesn’t render your reStructuredText as expected

Posted by jpluimers on 2018/04/13

One of the cool Github features is that it renders reStructuredText (and other markup documents like markdown).

Often however, your .rst file on GitHub looks very differently on GitHub as your local render. Heck: sometimes Github will not even render it at all.

 

–jeroen

Posted in Development, Lightweight markup language, MarkDown, Power User, reStructuredText, Software Development | Leave a Comment »

Comparison of Common markup for Markdown and reStructuredText · GitHub

Posted by jpluimers on 2017/10/09

This is a very good comparison of how to use reStructuredText and Markdown well for rendering at GitHub: [WayBackCommon markup for Markdown and reStructuredText · GitHub.

It is being updated by Alex Dupuy over time at https://gist.github.com/dupuy/1855764 and has two sections:

And it refers to http://pandoc.org/try/ which I had missed when starting with reStructuredText a long time ago.

Examples in there are actually more useful to me than these reStructuredText ones:

–jeroen

Posted in Development, Lightweight markup language, MarkDown, Power User, reStructuredText, Software Development | 2 Comments »

reStructuredText Interpreted Text Roles

Posted by jpluimers on 2017/10/04

There is so much great stuff in reStructuredText, take for instance [WayBackreStructuredText Interpreted Text Roles where basically can create your own role (for instance :csharp: or :delphi: roles based on :code: for syntax-highlighted code blocks given the right syntax highlighters).

I got there via this great piece by[WayBackChris who answered [WayBackInline code highlighting in reStructuredText – Stack Overflow:

Having looked into this some more I stumbled upon the document reStructuredText Interpreted Text Roles. From this document:

Interpreted text uses backquotes (`) around the text. An explicit role marker may optionally appear before or after the text, delimited with colons. For example:

This is `interpreted text` using the default role.

This is :title:`interpreted text` using an explicit role.

It seems that there is a code role, so you can simply type

:code:`a = b + c`

to render an inline code block. To get syntax highlighting you can define a custom role. For example

.. role:: bash(code)
   :language: bash

which you can then use like so:

Here is some awesome bash code :bash:`a = b + c`.

Note, the document I link to makes no mention of the version of docutils to which it refers. The code role is not available in docutils 0.8.1 (which is the only version I have to test against).

–jeroen

Posted in .NET, C#, Delphi, Development, Lightweight markup language, reStructuredText, Software Development | Leave a Comment »

 
%d bloggers like this: