Comments (12)
-
A comparatively more gluttonous (but also more powerful) evaluation model.
-
Subfolders can have their own pagetree files, but they’re not required. I suggest you work backward from how you want to build your project, and let that dictate where the pagetree files are. For instance, for Beautiful Racket, I have one pagetree at the top, but it dynamically collects pages from subdirectories too. (And it can do this because a pagetree source is a self-contained program, etc.)
from pollen-users.
ahh. wait, so how would I grab the file of a subdirectory?
#lang pollen
--
burial.html
chess.html
sermon.html
./Chapter_1/Part1.html //relative and absolute paths don't work.
edit: ohh wait.. so I have to use (string->path) ?
EDIT2: i dont know why i didnt seek to look in the module reference documentation lol. reading it now
from pollen-users.
See Nesting pagetrees for one approach.
from pollen-users.
@mbutterick so how would i generate a table of contents? i'm unsure how to import index.ptree
from pollen-users.
If you want to import ALL the data, you can just (require "index.ptree")
into the table of contents page. Every .ptree
file, including index.ptree
, exports a doc
variable with the pagenodes in it.
You can also selectively call pagetree helper functions like children
and pass index.ptree
as the pagetree source.
from pollen-users.
Got it! One more question(sorry, a little new to racket), how do I flatten out a nested list?
'((ul
(li (a ((href "00-Intro/00-Overview.html")) "00-Intro/00-Overview.html"))
(li (a ((href "00-Intro/01-Language.html")) "00-Intro/01-Language.html"))
(li (a ((href "00-Intro/02-Boolean_Logic.html")) "00-Intro/02-Boolean_Logic.html"))
(li (a ((href "00-Intro/03-Optimization.html")) "00-Intro/03-Optimization.html"))
(li (a ((href "00-Intro/04-NAND_HDL.html")) "00-Intro/04-NAND_HDL.html"))
(li (a ((href "00-Intro/05-Multibit_buses.html")) "00-Intro/05-Multibit_buses.html")))
(ul
(li (a ((href "01-ALU/01-BinaryNumbers.html")) "01-ALU/01-BinaryNumbers.html"))
(li (a ((href "01-ALU/02-BinaryAddition.html")) "01-ALU/02-BinaryAddition.html"))
(li (a ((href "01-ALU/03-ALU.html")) "01-ALU/03-ALU.html"))))
I've been doing (car l)
and (car (cdr l))
and this isn't going to scale well..
from pollen-users.
from pollen-users.
Also look at the functions in txexpr
(included with Pollen) for when you’re dealing with X-expressions. For instance, if you wanted a flat list of the li
elements from the above, you could do:
(append-map get-elements your-list)
from pollen-users.
So every page I have has a <time>4/19/20</time>
tag and I want to grab all of them and create a TOC with the dates next to the title of pages.
Doing (select 'time path)
gives me:
make-directory: cannot make directory
path: /usr/share/racket/pkgs/errortrace-lib/errortrace/compiled/drracket/
system error: Permission denied; errno=13
Is this the correct way to grab dates from every page?
from pollen-users.
That should work, though the error doesn’t make sense — it seems to be a file-permissions error triggered by something DrRacket is doing, not by Pollen per se. (Try running the same file from racket
on the command line to see if the error is different.)
You can also store a time value in the metas
table and extract it that way (could be faster in certain circumstances).
from pollen-users.
Same error... I'm calling it correctly right? (select 'time 'chapter1/test.html)
, I also tried: (select 'time (build-path (current-directory) "chapter1" "test.html"))
?
I do actually have write permissions on the drive.. (make-directory) works fine.
from pollen-users.
I feel it's going to be a back and forth conversation with little information gain to help you debugging if we just keep doing this. Do you have a link to your project? Or can you provide us a minimal template file / pollen.rkt
and the problematic source file?
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.