-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #915 from sappelhoff/fix/pdf/internal_links
[INFRA] PDF version of spec: fix handling of internal links
- Loading branch information
Showing
15 changed files
with
265 additions
and
77 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
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
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
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,29 @@ | ||
"""Inspect the pandoc log for warnings that should be raised as errors.""" | ||
|
||
# %% | ||
import json | ||
|
||
# see pandoc_script.py | ||
LOGFILE = "bids-spec_pandoc_log.json" | ||
|
||
# read the log file | ||
with open(LOGFILE, "r") as fin: | ||
logs = json.load(fin) | ||
|
||
# go through the logs (list of dicts) | ||
duplicate_link_refs = [] | ||
for log_dict in logs: | ||
|
||
# Check for DuplicateLinkReference | ||
logtype = log_dict.get("type", None) | ||
logverbosity = log_dict.get("verbosity", None) | ||
|
||
if logtype == "DuplicateLinkReference" and logverbosity == "WARNING": | ||
duplicate_link_refs.append(log_dict) | ||
|
||
# raise errors if appropriate | ||
if len(duplicate_link_refs) > 0: | ||
msg = "\n\nFound duplicate link references. Please make them unique.\n" | ||
for log_dict in duplicate_link_refs: | ||
msg += "\n" + json.dumps(log_dict, indent=4) | ||
raise RuntimeError(msg) |
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
Oops, something went wrong.