Commit Graph

9 Commits

Author SHA1 Message Date
Eli Barzilay
bba5d06448 Remove some redundant "www."s.
original commit: ef0f610ca73207fe661994677129d456493e47f9
2013-04-28 12:53:07 -04:00
Greg Hendershott
58fab5c3a6 Combine adjacent code spans into one.
These result from something like

    @racket[(x y)]

being treated by Scribble as multiple RktXXX items rather than one. As
a result the Markdown emitted was:

    `(``x`` ``y``)`

But obviously instead we want:

    `(x y)`

Kludgosity alert: Although it would probably be more-correct to
consolidate the RktXXX items at the Scribble structure level, I don't
easily see how. `@racket` is baking in the concept of Racket
lexing (classifying text as various kinds of Racket elements). This is
handy when the render will be HTML or Latek, and is benignly N/A when
it will be plain text. But it's a bit square-peg/round-hole when the
render will be Markdown. Rather than attempt to "un-lex" the Scribble
structures (I'm having trouble seeing how), I'm handling it
"after-the-fact" -- adjusting the generated Markdown text.

If anyone thinks the preceding is an elaborate rationalization for an
ugly kludge, I wouldn't argue, but I would need some help
understanding the preferable way to go about it.

original commit: 59bba2d197a42448d21c7f899d197b890adc7c9e
2013-03-29 07:23:49 -06:00
Greg Hendershott
3f1ebb9565 Fix problem handling examples and interaction.
Unlike plain `racketblock`, `examples` and `interaction` are
"nested". As a result we emitted bad Markdown like:

    ```racket
    Examples:
    ```racket
    some-code
    ```
    ```

Markdown code blocks can't nest, so this needs to be:

    ```racket
    Examples:
    some-code
    ```

Also: Updated the unit test with examples of `examples` and
`interaction`.

original commit: a5f6686270239484a5e7b2e6864c9bd5627d937d
2013-03-29 07:23:49 -06:00
Greg Hendershott
c7f0f37159 Use Racket lexer for code blocks.
Had been specifying Scheme lexer for code blocks, while waiting for
new Racket lexer to wend its way from Pygments to Pygments.rb to
Linguist to GitHub.

That day is almost here: Linguist will soon update and deploy to
GitHub.  And Racket 5.3.2 is about to release.  As a result, I think
this is the correct time to switch to the Racket lexer: It should be
live on GitHub by the time people are using Racket 5.3.2.

/cc @rmculpepper -- I think this commit should go into the 5.3.2
release.

original commit: 4d3a5bad04d0958c71c70aaed0ab2c2055c5f272
2013-01-09 18:52:16 -07:00
Greg Hendershott
77b1b267b5 Fix bug with pound signs used to mark sections.
Also update tests/scribble/markdown-docs files accordingly.

original commit: faeba879e292414dd6d5d9e38d4a08b26e63cceb
2012-12-19 19:32:00 -07:00
Greg Hendershott
624b8ef7e4 Render Scribble margin-note as Markdown block-quote.
More precisely, do this for nested flows with the "refcontent" style.

For instance this Scribble:

    @margin-note{Note: This is a note. Let's make it long enough that the
    markdown output will have to line-wrap, to make sure the > mark starts
    each line properly.}

Will render as this Markdown:

    > Note: This is a note. Let's make it long enough that the markdown output
    > will have to line-wrap, to make sure the > mark starts each line
    > properly.

A site like GitHub.com will render this in a block-quote style
suitable for notes:

> Note: This is a note. Let's make it long enough that the markdown output
> will have to line-wrap, to make sure the > mark starts each line
> properly.

original commit: a3800cdc94d5f0c1b361d6e3ead6c1ebceb66288
2012-12-19 19:31:15 -07:00
Greg Hendershott
98e3fa52d8 Render italic and bold in Markdown.
Scribble => Markdown
  @bold{text}    **text**
@italic{text}     _text_

original commit: 00a5bf63b1819f324ea41b91ce8ee288e1dc7ff5
2012-12-12 20:58:44 -07:00
Greg Hendershott
cdc89f9685 Render @hyperlink in Markdown.
Render Scribble like

    @hyperlink["url" "content"]

as Markdown like

    [content](url)

Note that this only works for `@hyperlink`. The motivation is to
preserve content the author has explicitly written. (Previously,
`markdown-render.rkt` was discarding this; `text-render.rkt` still
does so.)

This does _not_ attempt to handle everything that `html-render.rkt`
would automatically generate and render as `<a>`. It simply can't --
things like hotlinked Racket keywords in code blocks simply won't work
in Markdown.

original commit: dbffc840a93ceb142c59df4a533ced0b41b8e4fa
2012-12-11 12:40:54 -07:00
Greg Hendershott
51d487bc1b Add a Markdown rendering mode to Scribble.
Uses "Github flavored markdown". Specifically, code blocks are opened
using ```scheme so that Github will lex and format them as Scheme code
rather than generic monospace.

Note: I would have used ```racket, but we are still waiting for the
pygments.rb project to pull again from pygments-main -- to which I
contributed a Racket lexer back in August. After pygments.rb pulls,
can update this to use ```racket instead.

original commit: 6aa6dc0400f4fed688e6f5b5278da2e34d82ad88
2012-12-09 15:17:36 -07:00