Skip to content

Support markdown-style quote blocks#9478

Merged
dlang-bot merged 1 commit intodlang:masterfrom
dgileadi:markdown-quotes
Mar 30, 2019
Merged

Support markdown-style quote blocks#9478
dlang-bot merged 1 commit intodlang:masterfrom
dgileadi:markdown-quotes

Conversation

@dgileadi
Copy link
Contributor

@dgileadi dgileadi commented Mar 23, 2019

Screenshot:

screenshot

Proposed documentation:

Quotes

Documentation may include a section of quoted material by prefixing each line of the section with a >. Quotes may include headings, lists, embedded code, etc.

/**
 * > To D, or not to D. -- Willeam NerdSpeare
 */

Lines of text that directly follow a quoted line are considered part of the quote:

/**
 * > This line
 * and this line are both part of the quote
 *
 * This line is not part of the quote.
 */

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @dgileadi! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#9478"

size_t delta = 0;
delta += MarkdownList.endAllNestedLists(buf, iLineStart, nestedLists);
delta += endAllMarkdownQuotes(buf, iLineStart, quoteLevel, quoteMacroLevel);
i += delta;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very similar to the code above. Can this be extracted somehow, or will that just make it more complicated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a function that combines the two, and hopefully addresses the quoteMacroLevel comment as well.

@jacob-carlborg
Copy link
Contributor

It would be nice with a screenshot of how this looks rendered. I suggest you include screenshots in future PRs as well.

@jacob-carlborg
Copy link
Contributor

Is this enabled by default or enabled using some flag?

@dgileadi
Copy link
Contributor Author

Is this enabled by default or enabled using some flag?

Like all the markdown features, it's enabled by the -preview=markdown flag. For this feature that flag is checked on line 3909.

@thewilsonator thewilsonator added the Merge:72h no objection -> merge The PR will be merged if there are no objections raised. label Mar 24, 2019
@jacob-carlborg
Copy link
Contributor

Like all the markdown features, it's enabled by the -preview=markdown flag. For this feature that flag is checked on line 3909.

Right, I missed that. 👍.

@dgileadi
Copy link
Contributor Author

Anything else holding this up?

@dlang-bot dlang-bot merged commit e1e9cf2 into dlang:master Mar 30, 2019
@thewilsonator thewilsonator removed the Merge:72h no objection -> merge The PR will be merged if there are no objections raised. label Mar 30, 2019
@dgileadi dgileadi deleted the markdown-quotes branch March 30, 2019 16:20
kinke added a commit to kinke/dmd that referenced this pull request Feb 18, 2020
Apparently introduced by dlang#9478; the placeholder was already used in 4736cf4 and later restored another time in 4e8d1cd.
kinke added a commit to kinke/dmd that referenced this pull request Feb 19, 2020
Apparently introduced by dlang#9478; the placeholder was already used in 4736cf4 and later restored another time in 4e8d1cd.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants