Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang] Fix formatting for FIRLangRef.html
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 Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D129186
- Loading branch information
1 parent
b379129
commit e7f05f2
Showing
5 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This script combines FIRLangRef_Header.md with the auto-generated Dialect/FIRLangRef.md | ||
# for the purpose of creating an introduction header/paragraph for FIRLangRef.html | ||
|
||
# These paths are relative from the build directroy, not source, as that's where this tool is exectued. | ||
header_path = 'Source/FIR/FIRLangRef_Header.md' | ||
docs_path = 'Dialect/FIRLangRef.md' | ||
output_path = 'Source/FIRLangRef.md' | ||
|
||
# 1. Writes line 1 from docs to output, (comment line that the file is autogenerated) | ||
# 2. Adds a new line | ||
# 3. Writes the entire header to the output file | ||
# 4. Writes the remainder of docs to the output file | ||
with open(output_path, 'w') as output: | ||
with open(header_path, 'r') as header, open(docs_path, 'r') as docs: | ||
output.write(docs.readline()) | ||
output.write("\n") | ||
output.write(header.read()) | ||
output.write(docs.read()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# FIR Language Reference | ||
|
||
This page contains an overview of the Fortran IR operations, their syntax, and example usages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters