Comments (2)
Pollen has no built-in facilities for building a keyword index for HTML; each author must design and implement their own system. It's quite an exercise. (Obviously, if you’re only targeting PDF via LaTeX, you can just use LaTeX’s system for this)
I have written a pretty good one for an upcoming project. Here’s an example of the output. It supports sub-entries using !
as a separator, with the idea that it will plug into LaTeX pretty easily if I need it to.
Roughly:
- In HTML, my
◊index
tag function callshtml-index
, which produces a link to the keyword index page with a custom attributedata-index-entry
as a kind of marker so it can be found again in the next step. - My site uses a SQLite database to cache a bunch of stuff about each article each time it is rendered. (I decided to have a bit of fun and call this “crystalization”) As part of this process, the
crystalize-index-entries!
function is called, which finds all links with adata-index-entry
attribute, and saves info about them into thekeywordindex
table of the database. - The program which generates the index is
keyword-index.rkt
. - Because each article also has its own row in the database, I can use the
rowid
column to simulate page numbers in the output.
A few years ago I prototyped another system which was much simpler. See these lines in pollen.rkt
and the template file that produced the keyword index page. It didn't support sub-entries and also did not use a SQLite database; it just loaded the doc
of each file in a given pagetree looking for index entries. The upside of using a database is that it is faster.
from pollen-users.
Hi!
Thank you for your help!
The example of the output for your upcoming project is really beautiful, unfortunatly I am a newbie and didn't understand very well how to do this... Maybe in the future (=
Pollen is awesome!
from pollen-users.
Related Issues (20)
- render index.ptree with subdirectories changes directory (though not project root) HOT 8
- Is parallel mode known to crash a lot? HOT 1
- decode-elements with decode-paragraphs inserts spurious <p> when nesting lists? HOT 2
- multiple text arguments? HOT 5
- serialising txexprs? HOT 2
- Beautiful Racket Racket docs HOT 1
- Classic tangle/weave support a la org/babel-mode HOT 2
- Add source tag to default block-tags HOT 3
- Importing text from other sources HOT 2
- One source file → multiple outputs of same type? HOT 6
- Having a hard time with maps HOT 4
- Metadata on pagenodes (?) / how to render link traversal HOT 5
- Filling templates multiple times, à la mail-merge -- maybe a non-use case? HOT 3
- Inserting html comment with pollen command HOT 4
- splitf-txexpr: how to use the resulting txexpr HOT 2
- Windows: Set Pollen environment variable HOT 2
- execute shell command via preprocessor?
- Mildy Dynamic Websites
- opinions sought: costs & benefits of switching to self-hosted Git server? HOT 17
- Could not find MANIFEST for package source HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pollen-users.