Commit Graph

12 Commits

Author SHA1 Message Date
Chris Penner
5ca1eb3b8d Replace '.' references with scratch/main 2024-06-25 11:11:07 -07:00
Paul Chiusano
685a202319 update transcripts 2022-12-01 23:51:11 -06: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
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
Paul Chiusano
b7bf12081b
Add Author and License metadata types to builtins (#1228)
* Fix #1056 and add author and license metadata types

* Transcript demonstrating that the codebase is empty at first
2020-02-13 10:59:53 -05: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
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