Theme documentation

Derek Van Ittersum's Avatar

Derek Van Ittersum

17 Aug, 2017 01:56 PM

Just trying things out and noticed in the default theme the "pairs" attribute colors a bunch of text: everything between quotation marks, brackets, parens, etc. This is a bit much for me, so I deleted it. Is there an attribute to just color links (e.g., [text]( or [link][linkref] )? I looked in some of the other theme files and found that one can target quotation marks, brackets, parens, but I didn't see anything about links.

  1. Support Staff 1 Posted by Fletcher on 17 Aug, 2017 02:07 PM

    Fletcher's Avatar

    The beta was just released yesterday. You think I have documentation yet??? ;)

    The syntax highlighter has a "cascading" model. pairs covers just about any paired construct with an opening and closing character (e.g. <...>, "...", etc.) You can then override specific instances (angles, brackets, etc) and even functions (e.g. citation, footnote, etc.)

    Check out the solarized themes for examples (and notice I disabled pairs for this reason -- to avoid being too heavy handed.

    Eventually there will be documentation on themes, and even a "contest" to submit themes for inclusion in the App.

  2. 2 Posted by Derek Van Itter... on 17 Aug, 2017 02:13 PM

    Derek Van Ittersum's Avatar

    Thanks! I didn't really expect documentation, sorry to sound pushy! :)

    I did see the examples in the solarized file. These are a bit broad though--I use brackets and parentheses quite a bit in my academic writing, so I don't want these colored. But I would like links colored, which use brackets and parentheses. Maybe consider this a feature request for down the road? The ability to target Markdown link syntax aside from "bracket" or "paren".

    Also: really looking forward to the "selective undo" feature. That sounds really interesting.

  3. Support Staff 3 Posted by Fletcher on 17 Aug, 2017 02:35 PM

    Fletcher's Avatar

    The problem is that any use of brackets is a link, e.g. [foo] is a link. But if MMD cannot find a definition for the link, it replaces it with the original brackets. So, more precisely, [foo] is a broken link, unless [foo]: exists somewhere else in the document. Determining that is more complex than one wants the app to try and figure out in between each keystroke to see if something has changed anywhere in the document.

  4. Support Staff 4 Posted by Fletcher on 17 Aug, 2017 02:38 PM

    Fletcher's Avatar

    PS> And yes, I'm intrigued by the selective undo functionality as well. I first built the underlying infrastructure a couple of years ago, but it didn't work well as a "patch on" to the existing v3 code. v4 was built with this functionality at the core, so it works very well (at least in all my testing). Making undo work selectively is now more an issue about creating the proper interface for it than any particular technical challenge.

  5. 5 Posted by Derek Van Itter... on 17 Aug, 2017 02:49 PM

    Derek Van Ittersum's Avatar

    Ok, that makes sense about the brackets.

    Here's an idea that would only work if people use inline links or define the links like so:

    [link anchor text][foo]

    So, obviously, if you think this is too narrow or whatever, disregard! I'm just trying to see if there's a middle ground or something.

    Basically, could we separate out brackets or parentheses with these conditions:

    reflink : only style bracket text if open bracket immediately preceded by closing bracket

    inlinelink: only style parentheses if immediately preceded by closing bracket

  6. Support Staff 6 Posted by Fletcher on 17 Aug, 2017 03:32 PM

    Fletcher's Avatar

    Intentionally causing a discrepancy between the way MMD parses text and
    the way Composer parses it is probably not a good idea. It leads to
    confusion of users, and sometimes of me. :)

    Additionally, it gets more complicated when you have multiple brackets,
    e.g. `[foo][bar][bat]`

    Better to leave it alone.


  7. Fletcher closed this discussion on 18 Aug, 2017 12:14 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac