Skip to content

More markdown settings #66

Merged
merged 4 commits into from
Feb 5, 2020
Merged

More markdown settings #66

merged 4 commits into from
Feb 5, 2020

Commits on Feb 4, 2020

  1. markdown: Disable Codehilite language guessing

    It appears that for random text the MIME lexer wins:
    
        In [4]: import pygments.lexer
        In [5]: pygments.lexers.guess_lexer("Hallo")
        Out[5]: <pygments.lexers.MIMELexer>
    
    which usually generates errors for random text:
    
        In [11]: from markdown.extensions.codehilite import CodeHilite
        In [12]: CodeHilite(src = 'Hallo').hilite()
        Out[12]: '<div class="codehilite"><pre><span></span><span class="err">Hallo</span>\n</pre></div>\n'
    
    which just look ugly (red border on each line).
    
    So switch off language guessing. In that case, code blocks without a
    explicit language are left as is:
    
        In [13]: CodeHilite(src = 'Hallo',guess_lang=False).hilite()
        Out[13]: '<div class="codehilite"><pre><span></span>Hallo\n</pre></div>\n'
    
    In Markdown, the language should be set explicitly, for language
    specific highlighting.
    
        :::python
        print("Hallo")
    donald committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    0401703 View commit details
    Browse the repository at this point in the history
  2. custom.css: Add vertical space after code

    The bulma style sets margin-bottom to 1em for several block-level
    elements (eg <p>). However the codehilite <div>s, generated by the
    codehilite Markdown extension don't have that. So we have 1em vertical
    space before a code block but not after, which just looks wrong.
    
    Add vertical space after codehilite <div>s.
    donald committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    2eb5d43 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2020

  1. Markdown: Add Admonition

    Add Admonition extension which allows to add class attributes and a
    title to a block. So
    
        !!!alert "Red Alert"
            Warp core breach
    
    becomes
    
        <div class="admonition alert">
          <p class="admonition-title">Red Alert</p>
          <p>Warp core breach</p>
        </div>
    donald committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    9e8f0b3 View commit details
    Browse the repository at this point in the history
  2. Markdown: Use monospace font for editor

    Add inline style to wagtailadmin/pages/edit.html to force the markdown
    textarea to monospaced font.
    donald committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    455abb1 View commit details
    Browse the repository at this point in the history