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,651 other followers

Archive for the ‘reStructuredText’ Category

Inline code highlighting in reStructuredText – Stack Overflow

Posted by jpluimers on 2017/08/15

To inline code inside reStructuredText embed it with back-ticks and pre-pend the first back-tick with :code:

This is how some text with :code:`a = b + c` embedded will look like.

This is how some text with a = b + c embedded will look like.

Source: Inline code highlighting in reStructuredText – Stack Overflow [WayBack]

The above is in addition to the a = b + c that renders to default code as described for instance by reST – reStructuredText — Sphinx/Rest Memo v1.0-14-ga2798e1 documentation [WayBack]

–jeroen

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

If only there was a plugin to convert a Google Suite Document into Markdown S…

Posted by jpluimers on 2017/06/29

via If only there was a plugin to convert a Google Suite Document into Markdown Syntax… – Kristian Köhntopp – Google+ [WayBack]

GitHub – mangini/gdocs2md: Convert a Google Drive Document to the Markdown format, suitable for publishing. [WayBack]

In the gapps language: Apps Script  |  Google Developers

Maybe one day – when I use Google Docs more often – I make a reStructuredText version

–jeroen

Posted in Development, gapps Google Apps Script, Google, Google Apps, Lightweight markup language, MarkDown, Power User, reStructuredText, Scripting, Software Development | Leave a Comment »

Github reStructuredText parser got less strict so it now does display parts it cannot fully render

Posted by jpluimers on 2017/05/25

As the pull request had been in the pipeline for almost 2 years, I missed it went through:

Before that, Github would not render parts of reStructuredText files at all it could not fully render them. Now it renders them as raw reStructuredText so at least you can see the content.

Examples:

.. function:: code_to_ast(codeobj)

–jeroen

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

reStructuredText Markup Specification – sections (that translate to HTML headings)

Posted by jpluimers on 2017/05/05

So I won’t forget; source: reStructuredText Markup Specification – Sections

[2]

The following are all valid section title adornment characters:

! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~

Some characters are more suitable than others. The following are recommended:

= - ` : . ' " ~ ^ _ * + #

Rather than imposing a fixed number and order of section title adornment styles, the order enforced will be the order as encountered. The first style encountered will be an outermost title (like HTML H1), the second style will be a subtitle, the third will be a subsubtitle, and so on.

Below are examples of section title styles:

===============
 Section Title
===============

---------------
 Section Title
---------------

Section Title
=============

Section Title
-------------

Section Title
`````````````

Section Title
'''''''''''''

Section Title
.............

Section Title
~~~~~~~~~~~~~

Section Title
*************

Section Title
+++++++++++++

Section Title
^^^^^^^^^^^^^

When a title has both an underline and an overline, the title text may be inset, as in the first two examples above. This is merely aesthetic and not significant. Underline-only title text may not be inset.

A blank line after a title is optional. All text blocks up to the next title of the same or higher level are included in a section (or subsection, etc.).

All section title styles need not be used, nor need any specific section title style be used. However, a document must be consistent in its use of section titles: once a hierarchy of title styles is established, sections must use that hierarchy.

Each section title automatically generates a hyperlink target pointing to the section. The text of the hyperlink target (the “reference name”) is the same as that of the section title.

I prefer this order because of decreasing “greyness”:

# * = + ^ ~ - : . _ ` ' "

–jeroen

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

Printing from the Atom editor

Posted by jpluimers on 2017/05/04

Atom is a great editor, but printing from it is still lacking, even though the issue has been opened again.

There is export-html, but it only prints the current source code, not the built-in Markdown Preview or add-on reStructuredText Preview Pandoc packages “Toggle Preview” views.

By name print-atom looks promising, but contrary to the advertised “Print current atom window using print dialog”, it prints the whole Atom UI, which is of no use at all.

The little red icon isn't an adornment. Even though it doesn't look like a button: It's clickable!

The little red icon isn’t an adornment. Even though it doesn’t look like a button: It’s clickable!

Then there is broadcast which at first only worked for me in 1.6.2 but not in 1.7.2. I even removed the whole ~/.atom directory to get it working: to no avail. It finally occurred to me that in the lower right there was a tiny red icon (which was blue in 1.6.2).

Below is the process to fix broadcast, and after that you can live-view from your web browser through http://localhost:8000 either of the rendered source text in the Atom editor, or the Preview pane in the Atom editor.

Even though hardly documented, these are the broadcast settings:

Only enable

Only enable “Broadcast To Others” if you want to access port 8000 from another machine.

Getting broadcast to work again

  • wasn’t caused by changes in the theming between 1.6.2 and 1.7.2 (where lots of colours changed)
  • wasn’t just an adornment: it’s in fact clickable

As soon as you click it you see this in the right pane:

Read the rest of this entry »

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

 
%d bloggers like this: