Page MenuHomePhabricator

Add WARNING and IMPORTANT to remarkup
ClosedPublic

Authored by btrahan on Jan 23 2014, 11:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 4:57 PM
Unknown Object (File)
Tue, Nov 26, 2:25 PM
Unknown Object (File)
Mon, Nov 25, 9:32 AM
Unknown Object (File)
Sun, Nov 24, 6:33 PM
Unknown Object (File)
Sun, Nov 17, 10:16 PM
Unknown Object (File)
Sun, Nov 10, 4:37 AM
Unknown Object (File)
Fri, Nov 8, 1:11 AM
Unknown Object (File)
Fri, Nov 8, 1:03 AM

Details

Reviewers
epriestley
Maniphest Tasks
Restricted Maniphest Task
Commits
rPHU10a688376d24: Add WARNING and IMPORTANT to remarkup
Summary

Ref T3116. This is basically the NOTE: rule except we consume WARNING and IMPORTANT.

Also adds (X) syntax for all three of (NOTE), (WARNING), and (IMPORTANT), which behave like the colon versions, just eating the keywords in html rendering.

Test Plan

played with it in phabricator proper; see next diff. also wrote a unit test

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

src/parser/xhpast/parser_nodes.php is updated because arc warned me it was out of date. i just followed the rebuild instructions and here we are.

One thing I've vaguely wanted is to have "WARNING" (yellow) and "IMPORTANT" (red) like NOTE. It would be nice to have a more semantic name for BUBBLE so it makes more sense when rendered in plain text, although I can't think of one offhand (CALLOUT or SIDEBAR aren't quite right). Maybe SIDENOTE, although that's not a word.

Another thought is that maybe we should just style NOTE the right way in legalpad? Or have a syntax which eats the word "NOTE", like:

(NOTE) asdf asdf asdf

So maybe:

  • Add (NOTE) syntax to eat the word "NOTE";
  • add WARNING and IMPORTANT for my personal benefit;
  • style notes the right way in legalpad?

Not sure if there's more ground to cover than that.

That is, all that junk would just go in the existing note rule.

That is also all just me making stuff up if it's terrible or whatever, I haven't really spent much time thinking about this beyond wanting WARNING and IMPORTANT.

That all sounds groovy to me

btrahan updated this revision to Unknown Object (????).Jan 24 2014, 12:46 AM

changes as suggested

my tests currently pass, but I feel like the 3 returns in the 2 types of output is weird? afaik its something about how we render block rules back to back though?

Oh, I also added (X) syntax for Note, Warning, and Important. I think its important to eat that text in the legalpad case at least / I'd be likely to use it a bit I think... If we can eat words in CSS though I'd be happy to just do that for legalpad and simplify this a bit.

Cool, seems reasonable to me. I'mma be all over these now.

my tests currently pass, but I feel like the 3 returns in the 2 types of output is weird? afaik its something about how we render block rules back to back though?

Oh -- I think maybe the rule could/should be consuming more whitespace in getMatchingLineCount(), and we're ending up with "note block, empty block, note block" or something. Getting it to consume extra whitespace at the end (and then trimming that in non-text modes) might fix things, maybe. But I woudn't worry about it too much.