Commit Graph

20 Commits

Author SHA1 Message Date
Greg Pfeil
0031542faf
Add a space before code block info strings
This is for consistency with the `cmark` style. Now the blocks we still
pretty-print ourselves will match the bulk of them that `cmark`
produces.
2024-07-10 13:56:07 -06:00
Greg Pfeil
1dc181b99a
Update the transcripts with cmark
`cmark`’s pretty-printer matches our output pretty well, with a few differences:
- it puts a space between the fence and the info string for in code blocks;
- it prefers `-` over `*` for bulleted lists (as do I) and it indents them;
- it `\`-escapes certain chars very conservatively;
- it prefers indented/unfenced code blocks if there is no info string; and
- it prefers `*` over `_` (unlike any sane person).

This also shows how the change fixes a number of issues:
- fix2158-1.output.md also illustrates how this change fixes #1809;
- alias-many.output.md and input-parse-errors.output.md show how fenced
  code blocks without an info string would use the beginning of the
  content as the info string;
- transcripts-round-trip/main.output.md shows how output blocks for
  generated `unison` stanzas (which could contain nested fenced blocks)
  might not have long-enough fences; and
- error-messages.output.md and generic-parse-errors.output.md show how
  Unison errors were reported on the wrong line number (and thus the
  printed error lines were also incorrect).
2024-07-10 13:37:51 -06:00
Chris Penner
5ca1eb3b8d Replace '.' references with scratch/main 2024-06-25 11:11:07 -07:00
Rúnar
3457a4b9c8 Transcript output 2024-01-25 10:12:10 -05:00
andrii
8b857b152c Adding a message for when ucm started reloading changes 2023-12-22 12:55:24 +01:00
Paul Chiusano
685a202319 update transcripts 2022-12-01 23:51:11 -06:00
Arya Irani
52b2c81783 never assume builtins are known to the db
fixes 107 failing transcripts
2021-12-06 11:55:21 -10:00
Paul Chiusano
0a5c9bb648 All tests and transcripts passing 2020-11-19 14:05:07 -05:00
Chris Gibbs
b3a4f497f0 Another fix to doc literal whitespace handling
Stop eating spaces that immediately follow @[source], @[evaluate] or @[include] directives on the same line, while unindenting.

Also fix docs.md so its example isn't asking for line-wrapping.
2020-04-13 17:27:58 +01:00
Chris Gibbs
8dfc25e68d Merge branch 'master' into topic/1363-doc-space-glitch 2020-04-13 16:07:21 +01:00
Arya Irani
81b6679bf3 update transcripts 2020-04-08 14:25:19 -04:00
Chris Gibbs
991e266267 Part of a fix for #1363 - preservation of spaces after @ directives in first line when unindenting
Still need to dig into impact on docs.output.md.
2020-03-16 23:06:17 +00:00
Chris Gibbs
6ca9bf7c41 stop doc literal normalization unindenting lines that start with @[...] 2020-01-26 15:51:11 +00:00
Chris Gibbs
22802b90cb #936 pretty-print doc literals - last tests and fixes 2020-01-16 21:55:41 +00:00
Chris Gibbs
e0da5f843c #936 pretty-print doc literals - small fix 2020-01-16 21:50:25 +00:00
Chris Gibbs
e0d49eac06 #936 pretty-print doc literals - draft of parse-time doc normalization - needs debugging 2019-12-21 22:07:11 +00:00
Chris Gibbs
81ce53a4af #936 pretty-print doc literals - paragraphyText now uses wrapPreserveSpaces 2019-12-19 00:08:47 +00:00
Chris Gibbs
776af61064 #936 pretty-print doc literals - spec out modified paragraph reflow/wrapping
Currently Unison takes doc literals like

  [:
  example usage:
   - note the call to bar
     - we pass it 1
  foo =
    bar 1
      baz
  :]

and renders them as

  [: example usage:
  - note the call to bar
  - we pass it 1
  foo =
  bar 1
  baz :]

due to the paragraph reflow/wrapping function.

Also, this function only works the first time you use it on a doc: if you `edit` a doc and mess with it, you won't get the wrapping refreshed the next time you view.  That's because the pretty-printing works by inserting newlines, which are treated as paragraph breaks by Unison the next time it sees the code.

I'm planning to fix this by
 - only doing paragraph reflow/wrapping for lines with zero indent (where zero is the left-most non-whitespace column of the doc)
 - normalizing docs during parse, including removing newlines that are within a paragraph.

See unison-src/transcripts/doc-formatting.md in this commit for more details of how this shakes out.  Not the .md.output because that's showing the current behavior without this change implemented.

Hopefully this is just a few more lines of code to implement, and then #936/#994 is good to merge.
2019-12-16 23:32:36 +00:00
Chris Gibbs
6be8932b38 #936 pretty-print doc literals - unindent docs after parsing - unfinished
Causes some bogus changes to docs.output.md which I need to debug.
2019-12-14 18:15:32 +00:00
Chris Gibbs
8ee3ea30f8 \:] to escape :] in doc literals 2019-11-30 15:58:31 +00:00