This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][Docs] Improve code formatting in instruction referencing doc
ClosedPublic

Authored by jryans on Jun 1 2022, 3:16 AM.

Details

Summary

This adds code blocks and inline code formatting to improve the readability of
the instruction referencing doc.

Diff Detail

Event Timeline

jryans created this revision.Jun 1 2022, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 3:16 AM
jryans requested review of this revision.Jun 1 2022, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 3:16 AM
jryans added a subscriber: debug-info.

Hi @jryans, thanks for this update. I'm not particularly familiar with reStructuredText formatting so I've just been looking at an existing doc (https://github.com/llvm/llvm-project/blob/main/llvm/docs/LangRef.rst) to guide my review.

llvm/docs/InstrRefDebugInfo.md
25–28

I'm not particularly familiar with reStructuredText formatting at all - do triple backticks format a code block? I can't see them used in https://github.com/llvm/llvm-project/blob/main/llvm/docs/LangRef.rst. It looks like that document uses .. code-block::, as in:

.. code-block:: llvm

%2 = add i32 %0, %1
call void @llvm.dbg.value(metadata i32 %2,
48

It looks like double backticks (rather than single) are used to format code inline in reStructuredText.

jryans added a comment.Jun 7 2022, 2:13 AM

Thanks for taking a look @Orlando!

Unlike most historical LLVM docs, this file is using Markdown, which ends up rendered together with the reStructuredText docs by Sphinx. Markdown is recommended for new docs.

With Markdown in mind, please take another look when you have time. 🙂

Orlando accepted this revision.Jun 7 2022, 3:05 AM

Thanks for taking a look @Orlando!

Unlike most historical LLVM docs, this file is using Markdown, which ends up rendered together with the reStructuredText docs by Sphinx. Markdown is recommended for new docs.

With Markdown in mind, please take another look when you have time. 🙂

Thanks for the link, I had completely missed that (and managed to miss the .md file extension - oops!). Yep this LGTM, thanks.

This revision is now accepted and ready to land.Jun 7 2022, 3:05 AM
jryans marked 2 inline comments as done.Jun 7 2022, 4:12 AM

Thanks for the review! 😄

Since this is a pretty clear improvement and docs-only, I'll go ahead and land it now without waiting for further comments.

This revision was landed with ongoing or failed builds.Jun 7 2022, 4:18 AM
This revision was automatically updated to reflect the committed changes.