Commit Graph

12 Commits

Author SHA1 Message Date
rlmark
79ad0fa8df updates transcripts 2021-08-23 14:05:37 -07: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
Runar Bjarnason
64848d5d4e Don't show the name of the term 2020-03-06 10:59:13 -05: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
Runar Bjarnason
ea9684efaf Fixed argument order and transcripts 2020-02-07 15:17:43 -05:00
Chris Gibbs
22ebf28e8a #936 pretty-print doc literals - improve commenting 2020-01-16 22:54:52 +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
8ee3ea30f8 \:] to escape :] in doc literals 2019-11-30 15:58:31 +00:00
Chris Gibbs
408f4ca393 #936 pretty-print doc literals - done, with some snags remaining 2019-11-24 22:04:20 +00:00
Paul Chiusano
d296266602 simplify paragraphyText, it's now much better behaved 2019-11-04 21:15:13 -05:00
Paul Chiusano
d28e532aa6 update docs example 2019-11-04 18:18:36 -05:00
Paul Chiusano
d3ab6ae190 Added a documentation transcript 2019-11-04 18:00:25 -05:00