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

[WIP] Custom label prefixes #174

Open
wants to merge 162 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
18d71d8
[any-prefix]: inital proof of concept
lierdakil Dec 17, 2017
f8baaf5
Merge branch 'master' into any-prefix
lierdakil Dec 28, 2017
0fc3cb8
Bump dependencies
lierdakil Dec 29, 2017
5e11072
Merge branch 'master' into any-prefix
lierdakil Apr 3, 2018
fea6f5a
Fix reference sequence compactification
lierdakil Apr 3, 2018
1b1f6a2
Reasonable defaults for prefix settings
lierdakil Apr 3, 2018
cd9226f
More prefix settings
lierdakil Apr 3, 2018
eebad20
Bring subfigures back
lierdakil Apr 3, 2018
36b3531
Add prefix defns for tables and sections
lierdakil Apr 3, 2018
38daf9e
Fix basic test
lierdakil Apr 3, 2018
e827a31
Only ouput sub-object as LaTeX subfigures if objects are figures
lierdakil Apr 3, 2018
566e328
Fix test
lierdakil Apr 3, 2018
26fa896
Fix capitalized label lookup
lierdakil Apr 3, 2018
f870ada
Re-add list-of
lierdakil Apr 3, 2018
1a06945
Variable scope priority in prefix reader
lierdakil Apr 3, 2018
6d0c9ab
Fix reference counting
lierdakil Apr 3, 2018
2963cad
Fix label names
lierdakil Apr 3, 2018
74da579
Remove debug traces
lierdakil Apr 3, 2018
fa6b28b
Custom settings type and Semigroup instance
lierdakil Apr 3, 2018
151551c
Update demo.md
lierdakil Apr 3, 2018
fe8ce6d
Bump stack resolver
lierdakil Apr 3, 2018
cc54e81
Dedicated counter for references
lierdakil Apr 3, 2018
2957de0
Reset counters on chapter change when appropriate
lierdakil Apr 3, 2018
747f80d
Fix tests
lierdakil Apr 3, 2018
538e1b1
Minimal scoping
lierdakil Apr 3, 2018
8e03e06
Some work towards arbitrary reference-able elements
lierdakil Apr 3, 2018
e13af37
Remove hard-coded label prefixes, clean-up some old code
lierdakil Apr 7, 2018
2ec1999
removed commented-out code
lierdakil Apr 7, 2018
5da0d84
Reduce name shadowing
lierdakil Apr 7, 2018
9de84d1
Clean up warnings
lierdakil Apr 7, 2018
c758dde
Re-enable some cleveref settigns
lierdakil Apr 13, 2018
0894f00
GHC 8.4 support
lierdakil May 1, 2018
cd338a1
Add git commit info to version output
lierdakil May 1, 2018
49cc6f6
Merge branch 'master' into any-prefix
lierdakil Jul 9, 2018
0ae2769
Update failing LaTeX test
lierdakil Jul 9, 2018
8988f57
Update for pandoc-types v1.17.5.1
lierdakil Jul 9, 2018
6c6d56f
Merge branch 'master' of github.com:lierdakil/pandoc-crossref
lierdakil Sep 19, 2018
c0503d6
Merge branch 'master' into any-prefix
lierdakil Nov 24, 2018
508487f
Fix broken TeX preamble settings; configurable TeX prefixes
lierdakil Nov 24, 2018
2483e35
Fix #211
lierdakil Jan 10, 2019
1a094a8
Merge branch 'master' into any-prefix
lierdakil Jan 20, 2019
3ea5cad
Merge branch 'master' into any-prefix
lierdakil Jan 22, 2019
b671918
Merge branch 'master' into any-prefix
lierdakil Jan 23, 2019
cd4299e
Merge branch 'master' into any-prefix
lierdakil Jan 23, 2019
84b8e1f
Merge branch 'master' into any-prefix
lierdakil Jan 23, 2019
bfd3075
Merge branch 'master' into any-prefix
lierdakil Jan 24, 2019
97e701d
Merge branch 'master' into any-prefix
lierdakil Feb 15, 2019
cb12fdf
Test and fix for #219
lierdakil Feb 15, 2019
82473ca
Some groundwork for scoping; lot of stuff broken (see below)
lierdakil Mar 2, 2019
6cfc90d
Minimal tests for scoping
lierdakil Mar 2, 2019
7c19f17
Fix some tests with minimal breakage
lierdakil Mar 2, 2019
a7c057b
Update cabalfile
lierdakil Mar 2, 2019
d756676
Fix `ref` meta prefix option type to inlines
lierdakil Mar 2, 2019
728a512
Add capitalization integrative test
lierdakil Mar 2, 2019
181c43a
Fix some primary tests; disable subfigure tests for now
lierdakil Mar 2, 2019
cc71955
Move default prefix config to settings; simplify reference templates
lierdakil Mar 2, 2019
f5a0b29
Lints
lierdakil Mar 2, 2019
c7b0e1c
Let numbering type depend on scope level; move default to settings
lierdakil Mar 2, 2019
2d704af
Make listOfTitle into a template, too
lierdakil Mar 2, 2019
4209dd1
Unify template variable interface
lierdakil Mar 2, 2019
8b638bd
Fix prefixes.eq.title meta type
lierdakil Mar 2, 2019
434fb45
Add list-of integrative test
lierdakil Mar 2, 2019
f7805c5
Use content as title for inline objects without title.
lierdakil Mar 2, 2019
492fe38
Add template for list-of items
lierdakil Mar 2, 2019
b7bd42b
Use ref-able object attributes as a source of template variables, too
lierdakil Mar 2, 2019
8147264
More type safety in Refs and fix simple LaTeX capitalization
lierdakil Mar 2, 2019
d4d27b0
Move towards using monad stack to report errors/warnings
lierdakil Mar 3, 2019
b9481f7
Fix test
lierdakil Mar 3, 2019
6dd2c95
Fix more tests and some related minor bugs
lierdakil Mar 3, 2019
f3e6c24
See full message
lierdakil Mar 3, 2019
3f1348e
Groundwork for subfigures
lierdakil Mar 3, 2019
39ead54
Subfugures: collect captions
lierdakil Mar 3, 2019
03f31c8
Update demo.md to work with subfigures
lierdakil Mar 3, 2019
7ffd91b
Add GPL headers to new files
lierdakil Mar 3, 2019
8724d51
Merge branch 'master' into any-prefix
lierdakil Mar 7, 2019
7f5f7be
Use applicative parser
lierdakil Mar 8, 2019
44c1b1a
Tests update for Pandoc 2.7
lierdakil Mar 8, 2019
3fcf310
Template variables: options and objects by index
lierdakil Mar 8, 2019
495efaa
Test for template var option
lierdakil Mar 8, 2019
cb3ed49
Test for referencing objects in template
lierdakil Mar 8, 2019
7a7157d
Test/example of numbering parts
lierdakil Mar 8, 2019
ec33f99
Fix subtle inconsistency wrt $$i$$ var in captionIndexTemplate and el…
lierdakil Mar 8, 2019
2757583
Merge branch 'master' into any-prefix
lierdakil Mar 8, 2019
2d32003
Caption placement initial
lierdakil Mar 8, 2019
e49b0bc
Configurable default and auto section prefix
lierdakil Mar 8, 2019
fa04713
Merge branch 'master' into any-prefix
lierdakil Mar 8, 2019
28b1b30
Give up on "nice" LaTeX output for now.
lierdakil Mar 9, 2019
dcc9965
Streamline math handling
lierdakil Mar 9, 2019
3c94139
Remove some unused TH code
lierdakil Apr 17, 2019
525988a
Remove obsolete tests
lierdakil Apr 26, 2019
fe99969
Clean up subfigures code
lierdakil Apr 26, 2019
b9718f9
Enable subcaptionsGrid by default
lierdakil Apr 26, 2019
a472cc2
Update m2m tests
lierdakil Apr 26, 2019
e3c5601
Suppress toprule and bottomrule in subcaptions grid LaTeX output
lierdakil Apr 26, 2019
2035f42
Wrap subcaptionGrid cells in a bogus div for compat with ODT writer
lierdakil Apr 26, 2019
00921df
Merge branch 'master' into any-prefix
lierdakil Apr 26, 2019
a54452b
Update subcaptionGrid test
lierdakil Apr 26, 2019
c763a7e
Access raw prefix definition via varfunc (incl. scope's definition); …
lierdakil May 1, 2019
097bfe5
Update demo.md
lierdakil May 1, 2019
6e309d6
String and number literals in template variable indexed access
lierdakil May 1, 2019
422f807
Code clean-up; more clear settings names wrt section label adjustment
lierdakil May 1, 2019
5e2f815
Add crossrefOutputFormat variable
lierdakil May 1, 2019
bc57538
Added a way to suppress default settings; more flexible default setti…
lierdakil May 1, 2019
5669c99
Clean-up demo.md
lierdakil May 1, 2019
a9e5954
Remove demo-chapters test as currently obsolete
lierdakil May 1, 2019
3e2fbde
Fix test
lierdakil May 1, 2019
5a0d02b
Fix test
lierdakil May 1, 2019
5e6e5bc
Merge branch 'any-prefix' of github.com:lierdakil/pandoc-crossref int…
lierdakil Aug 4, 2019
da66f55
Pin Pandoc version to 2.7.3
lierdakil Aug 4, 2019
bb1fe27
Use xcode10.2 for OSX Travis builds
lierdakil Aug 4, 2019
027c33b
Clean up test code; enable flaky tests in cabal-v2 builds
lierdakil Oct 5, 2019
eda155c
Merge branch 'master' into any-prefix
lierdakil Nov 23, 2019
6e73e2b
Move default `referenceIndexTemplate` for sections to upper level
lierdakil Nov 23, 2019
75743f4
Update test expectations
lierdakil Nov 23, 2019
034b043
Update test inputs
lierdakil Nov 24, 2019
7e7f575
Fix CI configs
lierdakil Nov 24, 2019
b27a909
Remove extraneous dependency on extra
lierdakil Nov 24, 2019
95c2037
Fix unnumbered headings
lierdakil Nov 24, 2019
31ee6e8
Remove redundant import
lierdakil Nov 24, 2019
cd8d974
Add GitHub CI builds for macos and windows [ci skip]
lierdakil Nov 24, 2019
4b43494
Disable other CI for now
lierdakil Nov 24, 2019
6db8142
Always run cabal update
lierdakil Nov 24, 2019
070d47d
Add make release workflow
lierdakil Nov 25, 2019
9f00ac3
Fix release
lierdakil Nov 25, 2019
726c41f
Bump pandoc version
lierdakil Nov 27, 2019
cef5480
Fix download-artifact
lierdakil Nov 27, 2019
13d144e
Build for pandoc 2.8.1
lierdakil Dec 6, 2019
903e59a
Bump version constraints
lierdakil Dec 12, 2019
371ddbd
Fix ManData
lierdakil Dec 12, 2019
a22c55d
[CI] Update pandoc version
lierdakil Dec 12, 2019
0d0dca2
Update unhierarchicalize to pandoc 2.9
lierdakil Dec 14, 2019
02ec774
Merge branch 'master' into any-prefix
lierdakil Mar 8, 2020
a9126a9
Readme badge branch
lierdakil Mar 8, 2020
abaa1da
[CI][Bintray] add commit sha to filenames
lierdakil Mar 8, 2020
db434cf
[CI] Pack Windows assets with 7zip
lierdakil Mar 12, 2020
e59dba5
[CI][Bintray] Try a more sophisticated upload to Bintray
lierdakil Mar 12, 2020
0ff85c0
[README] Remove AppVeyor link
lierdakil Mar 12, 2020
8008074
[CI] Bump pandoc
lierdakil Apr 9, 2020
c3c79c0
Merge branch 'master' into any-prefix
lierdakil Apr 20, 2020
14da0b7
Fix tests
lierdakil Apr 20, 2020
c470469
Merge branch 'master' into any-prefix
lierdakil Jun 20, 2020
7931586
[CI] Mark as prerelease
lierdakil Jun 20, 2020
fab05d7
[CI] Force cabal config init
lierdakil Jun 20, 2020
6a70f66
Merge branch 'master' into any-prefix
lierdakil Jun 20, 2020
59a9ee8
Merge branch 'master' into any-prefix
lierdakil Jun 20, 2020
a792fa6
Merge branch 'master' into any-prefix
lierdakil Jul 2, 2020
88aa81e
Merge branch 'master' into any-prefix
lierdakil Sep 4, 2020
40a8b12
[CI] Fix BinTray descriptions
lierdakil Sep 4, 2020
73fddcf
Add scope reference index variable `s.refi` to referenceIndexTemplate
lierdakil Sep 26, 2020
f188b9a
Use reference index in default sec referenceIndexTemplate
lierdakil Sep 26, 2020
19935fb
Merge branch 'master' into any-prefix
lierdakil Sep 26, 2020
9c2b2ec
Merge branch 'master' into any-prefix
lierdakil Dec 10, 2020
592cbfe
Hierarchical section numbering for numberSections
lierdakil Dec 10, 2020
48049b0
Fix demo test
lierdakil Dec 10, 2020
2b7edb2
Merge branch 'master' into any-prefix (some issues)
lierdakil Mar 21, 2021
004e763
Move default settings to embedded yaml files
lierdakil Mar 21, 2021
f174256
Support variables in prefix/suffix
lierdakil Mar 21, 2021
65d5d81
Tweak numberSections to align better with pandoc-crossref v0.3
lierdakil Mar 21, 2021
c67fd2d
Add `titleSections` option; fix demo.md
lierdakil Mar 21, 2021
1e8bc65
[CI] do not fail-fast
lierdakil Mar 22, 2021
d613fc2
Update cabalfile
lierdakil Mar 22, 2021
179d8bd
[CI] Try nuking the cache
lierdakil Mar 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on: [push]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
pandocver: ["2.13"]
Expand Down Expand Up @@ -38,11 +39,11 @@ jobs:
- uses: actions/cache@v2
with:
path: .cabal-store
key: r2-${{runner.os}}-${{matrix.ghcver}}-${{matrix.pandocver}}-${{hashFiles('pandoc-crossref.cabal')}}-${{hashFiles('dist-newstyle/cache/plan.json')}}
key: r3-${{runner.os}}-${{matrix.ghcver}}-${{matrix.pandocver}}-${{hashFiles('pandoc-crossref.cabal')}}-${{hashFiles('dist-newstyle/cache/plan.json')}}
restore-keys: |
r2-${{runner.os}}-${{matrix.ghcver}}-${{matrix.pandocver}}-${{hashFiles('pandoc-crossref.cabal')}}-${{hashFiles('dist-newstyle/cache/plan.json')}}
r2-${{runner.os}}-${{matrix.ghcver}}-${{matrix.pandocver}}-${{hashFiles('pandoc-crossref.cabal')}}
r2-${{runner.os}}-${{matrix.ghcver}}-${{matrix.pandocver}}
r3-${{runner.os}}-${{matrix.ghcver}}-${{matrix.pandocver}}-${{hashFiles('pandoc-crossref.cabal')}}-${{hashFiles('dist-newstyle/cache/plan.json')}}
r3-${{runner.os}}-${{matrix.ghcver}}-${{matrix.pandocver}}-${{hashFiles('pandoc-crossref.cabal')}}
r3-${{runner.os}}-${{matrix.ghcver}}-${{matrix.pandocver}}
- shell: bash
run: |
rm -rvf .cabal-store/ghc-${{matrix.ghcver}}/pandoc-crossref-*
Expand Down Expand Up @@ -144,6 +145,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
prerelease: true
body_path: description.md
files: |
assets/*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pandoc-crossref filter ![Build status](https://github.com/lierdakil/pandoc-crossref/workflows/Haskell%20CI/badge.svg)
# pandoc-crossref filter ![Build status](https://github.com/lierdakil/pandoc-crossref/workflows/Haskell%20CI/badge.svg?branch=any-prefix)

pandoc-crossref is a pandoc filter for numbering figures, equations,
tables and cross-references to them.
Expand Down
42 changes: 20 additions & 22 deletions docs/demo/demo.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
codeBlockCaptions: True
figureTitle: |
Figure #
lofTitle: |
## List of Figures
lotTitle: |
## List of Tables
tableTemplate: |
*$$tableTitle$$ $$i$$*$$titleDelim$$ $$t$$
autoSectionLabels: True
adjustSectionIdentifiers: True
autoFigLabels: fig
defaultOption:
- numberSections
- titleSections
- chapters
- subfigures
title: pandoc-crossref demo document
---

Expand All @@ -30,7 +28,7 @@ You can also have custom chapter reference labels, like @sec:custlabs

Subfigures are supported, see [@fig:subfigures; @fig:subfigureB]

# Chapter 1. Figures {#sec:sec1}
# Figures {#sec:sec1}

![First figure](img1.jpg){#fig:figure1}

Expand All @@ -45,10 +43,10 @@ Subfigures are supported, see [@fig:subfigures; @fig:subfigureB]

![Subfigure b](img1.jpg){#fig:subfigureB}

Subfigures caption
\: Subfigures caption. []{}
</div>

# Chapter 2. Equations {#sec:sec2}
# Equations {#sec:sec2}

Display equations are labelled and numbered

Expand All @@ -57,7 +55,7 @@ $$ P_i(x) = \sum_i a_i x^i $$ {#eq:eqn1}
Since 0.1.6.0 those can also appear in the middle of paragraph
$$a x^2 + b x^2 + c = 0$${#eq:quadr} like this.

# Chapter 3. Tables
# Tables

| First Header | Second Header |
|:-------------|:--------------|
Expand All @@ -73,7 +71,7 @@ Table without caption:
| Content Cell | Content Cell |
| Content Cell | Content Cell |

# Chapter 4. Code blocks
# Code blocks

There are a couple options for code block labels. Those work only if code block id starts with `lst:`, e.g. `{#lst:label}`

Expand Down Expand Up @@ -103,31 +101,31 @@ main = putStrLn "Hello World!"

## Wrapping div

Wrapping code block without label in a div with id `lst:...` and class, starting with `listing`, and adding paragraph before code block, but inside div, will treat said paragraph as code block caption.
Wrapping code block without label in a div with id `lst:...` and class, starting with `listing`, and adding paragraph after code block, but inside div, starting with `:` will treat said paragraph as code block caption.

<div id="lst:wrappingDiv" class="listing">
Listing caption
```{.haskell}
main :: IO ()
main = putStrLn "Hello World!"
```
: Listing caption
</div>

# Unnumbered chapter. {-}

This chapter doesn't change chapter prefix of referenced elements, instead keeping number of previous chapter, e.g.
$$ S(x) = \int_{x_1}^{x_2} a x+b \ \mathrm{d}x $$ {#eq:eqn2}

# Chapter 5. Reference lists
# Reference lists

It's also possible to show lists of figures and tables, like this:

\listoffigures
\listof{fig}

\listoftables
\listof{tbl}

\listoflistings
\listof{lst}

# Appendix A. Custom labels {label=AppA}
# Custom labels {label=A title=Appendix}

## This section will have custom label {#sec:custlabs label=CustLab}
## This section will have custom label {#sec:custlabs label=I}
13 changes: 8 additions & 5 deletions hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cradle:
- path: "./lib"
component: "lib:pandoc-crossref"

- path: "./lib-internal"
component: "pandoc-crossref:lib:pandoc-crossref-internal"

- path: "./src/pandoc-crossref.hs"
component: "pandoc-crossref:exe:pandoc-crossref"

Expand All @@ -12,14 +15,14 @@ cradle:
- path: "./src/Paths_pandoc_crossref.hs"
component: "pandoc-crossref:exe:pandoc-crossref"

- path: "./test"
- path: "./test/test-integrative.hs"
component: "pandoc-crossref:test:test-integrative"

- path: "./test"
component: "pandoc-crossref:test:test-pandoc-crossref"

- path: "./lib"
- path: "./test/test-pandoc-crossref.hs"
component: "pandoc-crossref:test:test-pandoc-crossref"

- path: "./test/bench-simple.hs"
component: "pandoc-crossref:bench:simple"

- path: "./test/Native.hs"
component: "pandoc-crossref:bench:simple"