Git Product home page Git Product logo

Comments (5)

femtomc avatar femtomc commented on June 26, 2024

Re -- I realized the first one was easy enough to work on:

◊(apply ol (map (lambda (node) `(li (a ((href ,(symbol->string node)))
        ,(car (select-from-doc 'h1 node)))))
        (pagetree->list (get-pagetree "index.ptree")))
)

e.g. this just uses the curated .ptree and a search over X-expressions to get the right thing.

The second one (forward and back links) I'm still stumped on.

from pollen-users.

mbutterick avatar mbutterick commented on June 26, 2024

As far as I can tell, there's no way to attach metadata to page nodes

Why not define-meta?

The second question is about rendering the forward / backward links in a graphical form. I know that pollen must do this already (right?)

The forward & backward links can be computed from a pagetree. (They could be computed other ways too.) But no, Pollen does not automatically render them “in a graphical form” — you would do that yourself.

I want to render a "knowledge graph" like representation of the link traversal

What does this mean — a graph of all the hyperlinks between pages? If so, I don’t see any alternative to reading the link tags out of the source files (assuming the links of interest are already tagged there; if not you would have to read & parse the output files) and imperatively building a graph. Racket’s graph library will output to graphviz format, so once you have a graph object, it’s easy to get a rendered diagram. (Not necessarily a pretty diagram, though.)

from pollen-users.

mbutterick avatar mbutterick commented on June 26, 2024

The second one (forward and back links) I'm still stumped on.

This is covered in the second tutorial in the Pollen docs.

from pollen-users.

femtomc avatar femtomc commented on June 26, 2024

@mbutterick -- I'm looking into pollen/core more, I realized I misunderstood that you could access metadata about the document directly (e.g. by using the pagenode reference).

Right, so basically: iterate over nodes in the page tree, and grab all "special" links (e.g. cross links to other nodes), then offload to graphviz.

I'm pretty close now, thanks for the help!

from pollen-users.

femtomc avatar femtomc commented on June 26, 2024

The forward & backward links can be computed from a pagetree. (They could be computed other ways too.) But no, Pollen does not automatically render them “in a graphical form” — you would do that yourself.

Here, I did a poor job -- I meant the traversal across the nodes (not the rendering).

from pollen-users.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.