Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul of the Manual #3189

Open
wants to merge 65 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
1e92e34
Generate docs from Markdown with Pandoc.
01mf02 Sep 30, 2024
9f7da22
GitHub Actions.
01mf02 Sep 30, 2024
6bd5c30
Do not build docs by default for now.
01mf02 Sep 30, 2024
6d193b6
Support note blocks.
01mf02 Oct 1, 2024
b8b8696
New structure for the manual.
01mf02 Oct 1, 2024
a5ee22c
Small improvements here and there.
01mf02 Oct 1, 2024
71cf646
Grammar.
01mf02 Oct 1, 2024
67d0716
Simpler handling of different block types.
01mf02 Oct 2, 2024
684d4e5
Enhance manual.
01mf02 Oct 2, 2024
ea59c0d
Example block.
01mf02 Oct 2, 2024
cd393ad
More on path expressions.
01mf02 Oct 2, 2024
1467298
Explanation.
01mf02 Oct 2, 2024
0b0cf29
Move stuff around, more on `and` and `or`.
01mf02 Oct 2, 2024
261f0bc
Work on man page.
01mf02 Oct 2, 2024
4c4a641
CLI.
01mf02 Oct 3, 2024
9f2b4df
Include subsections in TOC.
01mf02 Oct 4, 2024
55b7667
Modules, comments.
01mf02 Oct 4, 2024
9b6aff3
Indent subsections more nicely.
01mf02 Oct 4, 2024
b7cec85
Remove inactive button.
01mf02 Oct 4, 2024
fb181f0
(Re)move section.
01mf02 Oct 4, 2024
e2f29d0
Use details/summary for navigation.
01mf02 Oct 5, 2024
d269c13
Correct chevron behaviour on Chrome.
01mf02 Oct 5, 2024
d3ed376
Introduce blocks in man page.
01mf02 Oct 7, 2024
45befbf
Explanations.
01mf02 Oct 7, 2024
0b6902b
Document reduction with multiple output values.
01mf02 Oct 7, 2024
fa0b116
Definitions.
01mf02 Oct 7, 2024
e28245b
Scoping.
01mf02 Oct 8, 2024
f2f12f3
Start work on assignment.
01mf02 Oct 8, 2024
ac39187
Assignments.
01mf02 Oct 8, 2024
107b795
Complex assignments.
01mf02 Oct 9, 2024
f4cc5b4
Make tests a bit shorter and more precise.
01mf02 Oct 9, 2024
c205cf8
More on path expressions.
01mf02 Oct 9, 2024
5b61057
Moving.
01mf02 Oct 9, 2024
f4b39fa
Regenerate man page / tests.
01mf02 Oct 9, 2024
ea3881b
Document new `skip` function (03fa79c3bad2a47765265debdfe7dbe7d77df586).
01mf02 Oct 9, 2024
0c681c6
Rebuild tests / man page.
01mf02 Oct 9, 2024
4b4a5f7
Spacing.
01mf02 Oct 9, 2024
471b16e
Address @pkoppstein's remarks.
01mf02 Oct 10, 2024
b914c1e
Update man page.
01mf02 Oct 10, 2024
751e7bb
Make an example that shows how reduction handles destructuring.
01mf02 Oct 11, 2024
0f1b7fa
Second round of @pkoppstein's comments.
01mf02 Oct 15, 2024
c59ce73
Shorten examples in man page.
01mf02 Oct 15, 2024
c4c904f
Use definition lists for all non-HTML targets.
01mf02 Oct 15, 2024
808ac8c
Correct a few dangling references.
01mf02 Oct 15, 2024
8fc4307
Inline code for HTML and code blocks for everyone else.
01mf02 Oct 15, 2024
637fcb1
Clarify `input` behaviour, thanks to @pkoppstein.
01mf02 Oct 15, 2024
ac1cf5d
Move note about number representations from `.` to numbers section.
01mf02 Oct 15, 2024
529530e
Update tests / man page.
01mf02 Oct 15, 2024
d84ee39
Remake the objects subsection.
01mf02 Oct 16, 2024
20299eb
Remake destructuring subsection.
01mf02 Oct 16, 2024
ea8d171
Destructuring in reduction operators.
01mf02 Oct 17, 2024
23fa7d2
jaq supports `foreach/3` now.
01mf02 Oct 17, 2024
0c67e5f
jq -> jaq.
01mf02 Oct 17, 2024
1aa80cd
Spaces.
01mf02 Oct 17, 2024
a5fe551
Clearer equivalence.
01mf02 Oct 17, 2024
53f5fe5
Input of `(f)` in object pattern keys.
01mf02 Oct 17, 2024
52ce795
Split multiple outputs into multiple lines.
01mf02 Nov 6, 2024
80ebbfe
Be more explicit about ignoring input.
01mf02 Nov 6, 2024
80d0631
Integrate first round of @wader's comments.
01mf02 Nov 6, 2024
74c4e65
jaq now supports escaped comments.
01mf02 Nov 6, 2024
4bbc505
Document compound paths binding order.
01mf02 Nov 6, 2024
0c0a64c
Correct typo.
01mf02 Nov 6, 2024
1dbbb14
Integrate @wader's comments on if-then-else.
01mf02 Nov 6, 2024
1539242
Correct typo.
01mf02 Nov 6, 2024
1c50e64
More @wader suggestions.
01mf02 Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .github/workflows/manpage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,18 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install Pandoc
uses: pandoc/actions/setup@main
with:
python-version: '3.11'
cache: pipenv
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
run: pipenv sync
working-directory: docs
- name: Validate manual schema
run: pipenv run python3 validate_manual_schema.py content/manual/**/*.yml
working-directory: docs
version: 3.4
- name: Configure
run: |
autoreconf -i
./configure --enable-docs
- name: Build man page, man.test, manonig.test
run: |
mv jq.1.prebuilt jq.1.old
rm -f tests/man.test manonig.test
rm -f tests/man.test tests/manonig.test
make jq.1.prebuilt tests/man.test tests/manonig.test
- name: Make sure that jq.1.prebuilt, man.test, manonig.test are up to date
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Pandoc
uses: pandoc/actions/setup@main
with:
version: 3.4
- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down
20 changes: 8 additions & 12 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,9 @@ 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/dev/manual.yml
tests/man.test tests/manonig.test: $(srcdir)/docs/content/manual/manual.md
if ENABLE_DOCS
$(AM_V_GEN) ( cd ${abs_srcdir}/docs && \
$(PIPENV) run python validate_manual_schema.py content/manual/dev/manual.yml && \
$(PIPENV) run python build_mantests.py )
$(AM_V_GEN) ( cd ${abs_srcdir}/docs && ./build_mantests.sh )
else
@echo Changes to the manual.yml require docs to be enabled to update the manual test.
@echo As a result, the manual test is out of date.
Expand All @@ -176,11 +174,9 @@ 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/dev/manual.yml
jq.1.prebuilt: $(srcdir)/docs/content/manual/manual.md $(srcdir)/docs/man/*
if ENABLE_DOCS
$(AM_V_GEN) ( cd ${abs_srcdir}/docs && \
$(PIPENV) run python validate_manual_schema.py content/manual/dev/manual.yml && \
$(PIPENV) run python build_manpage.py ) > $@
$(AM_V_GEN) ( cd ${abs_srcdir}/docs && ./build_manpage.sh ) > $@
else
@echo Changes to the manual.yml require docs to be enabled to update the manpage.
@echo As a result, the manpage is out of date.
Expand Down Expand Up @@ -209,10 +205,10 @@ endif
install-binaries: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-exec

DOC_FILES = docs/content docs/public docs/templates \
docs/Pipfile docs/Pipfile.lock docs/build_manpage.py \
docs/build_mantests.py docs/build_website.py docs/README.md \
docs/validate_manual_schema.py docs/manual_schema.yml
DOC_FILES = docs/content docs/public docs/templates docs/filters \
docs/man docs/Pipfile docs/Pipfile.lock docs/build_manpage.sh \
docs/build_mantests.sh docs/build_website.py docs/README.md \
docs/build_manual.sh

EXTRA_DIST = $(DOC_FILES) $(man_MANS) $(TESTS) $(TEST_LOG_COMPILER) \
jq.1.prebuilt jq.spec src/lexer.c src/lexer.h src/parser.c \
Expand Down
29 changes: 2 additions & 27 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ dnl Code coverage
AC_ARG_ENABLE([gcov],
AS_HELP_STRING([--enable-gcov],[enable gcov code coverage tool]))

dnl Don't attempt to build docs if python deps aren't installed
dnl Documentation
AC_ARG_ENABLE([docs],
AS_HELP_STRING([--disable-docs],[do not build docs]), [], [enable_docs=yes])
AS_HELP_STRING([--enable-docs],[build docs]))

dnl Don't attempt to build the error injection object (if there is no LD_PRELOAD support)
AC_ARG_ENABLE([error-injection],
Expand All @@ -81,31 +81,6 @@ dnl Enable building all static
AC_ARG_ENABLE([all-static],
AS_HELP_STRING([--enable-all-static],[link jq with static libraries only]))

dnl find pipenv
AC_ARG_VAR([PIPENV], [pipenv command])
AC_CHECK_PROGS([PIPENV], pipenv)

AS_IF([test "x$enable_docs" != "xno"],[
AC_CACHE_CHECK([for Python dependencies], [jq_cv_python_deps],[
jq_cv_python_deps=yes
AS_IF([test "x$PIPENV" = "x" || \
! bmsg="`cd ${srcdir}/docs; LC_ALL=$LANG "$PIPENV" --venv`"],[
jq_cv_python_deps=no
])
])

AS_IF([test "x$jq_cv_python_deps" != "xyes"], [
AC_MSG_WARN([Error checking python dependencies: $bmsg
*****************************************************************
* Python dependencies for building jq documentation not found. *
* You can still build, install and hack on jq, but the manpage *
* will not be rebuilt and new manpage tests will not be run. *
* See docs/README.md for how to install the docs dependencies. *
*****************************************************************])
enable_docs=no
])
])

dnl Disable decNumber support
AC_ARG_ENABLE([decnum],
AS_HELP_STRING([--disable-decnum],[disable decnum support]))
Expand Down
6 changes: 4 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ Documentation
=============

The jq website, manpages and some of the tests are generated from this
directory. The manual is a YAML file in `content/manual`.
directory. The manual is a Markdown file in `content/manual/manual.md`.

To build the documentation (including building the jq manpage), you'll
To build the jq manpage and the tests contained in it, you'll
need `pandoc` (at least version 3.0).
To build the website, you'll additionally
need `python3` and `pipenv`. You can install `pipenv` like so:

pip install pipenv
Expand Down
251 changes: 0 additions & 251 deletions docs/build_manpage.py

This file was deleted.

2 changes: 2 additions & 0 deletions docs/build_manpage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
pandoc man/prologue.md content/manual/manual.md man/epilogue.md -s --to=man --lua-filter filters/filter.lua
Loading