This is an archive of the discontinued LLVM Phabricator instance.

[Flang] Fix formatting for FIRLangRef.html
ClosedPublic

Authored by DylanFleming-arm on Jul 6 2022, 4:10 AM.

Details

Summary

Previously, FIRLangRef.md was incorrectly formatted.
This was due to how FIRLangRef.md had no page header,
and so the first entry would render incorrectly.

This patch introduces a header file, which is prepended to the FIRLangRef
before it becomes a HTML file. The header is currently brief
but can be expanded upon at a later date if required.

This formatting fix also means the index page
can correctly generate a link to FIRLangRef.html and as such,
this patch also removes FIRLangRef from the sidebar and adds it to the main list of links.

Depends on D128650

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
DylanFleming-arm requested review of this revision.Jul 6 2022, 4:10 AM

Reworked CreateFIRLangRef.py to better fit pythons standards based upon internal review.

kiranchandramohan added inline comments.
flang/docs/FIR/CreateFIRLangRef.py
2

Do we need the path to the python executable here? Is this script expected to work if called from the command line with appropriate arguments?

Clang has the following for the scripts in docs/tools.

#!/usr/bin/env python3
# A tool to parse the FormatStyle struct from Format.h and update the
# documentation in ../ClangFormatStyleOptions.rst automatically.
# Run from the directory in which this file is located to update the docs.

I don't believe the path needs to be at the top here? I may be wrong but I think they're mainly for manual execution, This script should only realistically be ran as part of the HTML auto-generation process.
I've added a comment to the top of the file to explain it's purpose at least, I think that should be sufficient in this case.

LGTM. Have some Nit comments. Please address and submit directly. Make sure you rebase correctly over the dependent patch.

flang/docs/FIR/CreateFIRLangRef.py
3

Nit: full-stop at the end.

5

Nit: spelling: directory

6–8

Nit: There seems to be a style to name variables holding paths with CAPS.
Nit: Will this work on Windows or do you have to use os.path.join?

This revision is now accepted and ready to land.Jul 11 2022, 8:21 AM

Rebased onto main.

This revision was automatically updated to reflect the committed changes.