Skip to content

Commit

Permalink
website: Make latest release (1.7) be default manual
Browse files Browse the repository at this point in the history
Move deveopment manual.yml to dev/manual.yml
Symlink manual.yml to v1.7/manual.yml
Refactor to share history header with links to other manual versions.
Change man.test and man page generation to use dev/manual.yml

Related to jqlang#3078 jqlang#3127
  • Loading branch information
wader committed May 27, 2024
1 parent 7cd23f1 commit c294bce
Show file tree
Hide file tree
Showing 28 changed files with 42,998 additions and 3,840 deletions.
8 changes: 4 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ check_DATA = tests/man.test
# Making changes to the manpage without having the python deps means your
# tests won't run. If you aren't making changes to the examples, you probably
# don't care. But if you are, then you need to run the tests anyway.
tests/man.test tests/manonig.test: $(srcdir)/docs/content/manual/manual.yml
tests/man.test tests/manonig.test: $(srcdir)/docs/content/manual/dev/manual.yml
if ENABLE_DOCS
$(AM_V_GEN) ( cd ${abs_srcdir}/docs && \
$(PIPENV) run python validate_manual_schema.py content/manual/manual.yml && \
$(PIPENV) run python validate_manual_schema.py content/manual/dev/manual.yml && \
$(PIPENV) run python build_mantests.py )
else
@echo Changes to the manual.yml require docs to be enabled to update the manual test.
Expand All @@ -176,10 +176,10 @@ endif
# manpage, then we'll end up using the cached version. Otherwise, we need to
# rebuild it.
man_MANS = jq.1
jq.1.prebuilt: $(srcdir)/docs/content/manual/manual.yml
jq.1.prebuilt: $(srcdir)/docs/content/manual/dev/manual.yml
if ENABLE_DOCS
$(AM_V_GEN) ( cd ${abs_srcdir}/docs && \
$(PIPENV) run python validate_manual_schema.py content/manual/manual.yml && \
$(PIPENV) run python validate_manual_schema.py content/manual/dev/manual.yml && \
$(PIPENV) run python build_manpage.py ) > $@
else
@echo Changes to the manual.yml require docs to be enabled to update the manpage.
Expand Down
2 changes: 1 addition & 1 deletion docs/build_manpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def dedent_body(body):

def convert_manual_to_markdown():
f = StringIO()
manual = load_yml_file("content/manual/manual.yml")
manual = load_yml_file("content/manual/dev/manual.yml")
f.write(manual.get('manpage_intro', '\n'))
f.write(dedent_body(manual.get('body', '\n')))
for section in manual.get('sections', []):
Expand Down
2 changes: 1 addition & 1 deletion docs/build_mantests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
regex_program_pattern = re.compile(
r'\b(?:test|match|capture|scan|split|splits|sub|gsub)\s*\(')

with open('content/manual/manual.yml') as source, \
with open('content/manual/dev/manual.yml') as source, \
open('../tests/man.test', 'w') as man, \
open('../tests/manonig.test', 'w') as manonig:
manual = yaml.safe_load(source)
Expand Down
Loading

0 comments on commit c294bce

Please sign in to comment.