Git Product home page Git Product logo

Comments (2)

doowb avatar doowb commented on August 15, 2024

Below is a comment from #3 which I think belongs in this issue.

We are generating JavaScript Usage documentation via Assemble. We have a substantial amount of components to document. Component hbs files sit within sections and then modules. This means that the pages could be as many as 3 folders deep. Since we'd like to be able to just unzip the documentation and open an index.html file, we need to script out links between components relative to the current page.

For example in the example below i have 2 targets.

"sections": [
        { 
            "name": "Dataviz",
            "modules": [
                { 
                    "name": "Chart",
                    "components": [
                        { 
                            "name": "API",
                            "examples": [
                                { "title": "Benchmark", "src": "dataviz/api/benchmark.html" },
                                { "title": "API Functions", "src": "dataviz/api/api.html" }
                            ]
                        }
                    ]
                }
            ]
        }
    ]

I want to generate links that are relative to each within "examples" above. Sometimes, like I said, there'll be 3 directories deep, but other times they may be one or two.

Lets assume my documentation is within "docs". The user will open up the index.html on the root.

file://localhost/Users/rrullo/working/com.foo/docs/index.html

This page will contain links to "dataviz/api/benchmark.html" and "dataviz/api/api.html". Which will go to file://localhost/Users/rrullo/working/com.foo/docs/dataviz/api/benchmark.html and file://localhost/Users/rrullo/working/com.foo/docs/dataviz/api/api.html.

Now if the user now navigates to file://localhost/Users/rrullo/working/com.foo/docs/dataviz/api/benchmark.html, we need to be able to have the navigate back to '../../index.html' off of /Users/rrullo/working/com.foo/docs/

The relative helper looked darn close to what I needed.

Thanks!
-Bob

from handlebars-helpers.

jonschlinkert avatar jonschlinkert commented on August 15, 2024

I believe we got this working.

from handlebars-helpers.

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.