Docz: Support Relative Path

Created on 4 Jan 2019  路  16Comments  路  Source: doczjs/docz

Currently docz expect base in config and it only works in absolute paths, it will be nice that Docz support relative mode as well so that it should directly be opened without serving

Most helpful comment

+1 relative paths would be nice

All 16 comments

Would you mean _" open index.html"_ directly in your browser?

You don't need to do that.

If you are running any Unix based system such as Macosx or Linux, you can do that using python like that.

python -m SimpleHTTPServer

Then, open http://localhost:8000 and that's it.

@jancassio yes, we would like to publish the generated docs in Jenkins HTML publisher plugin(https://wiki.jenkins.io/display/JENKINS/HTML+Publisher+Plugin) so that code reviewer could visualize changes before approval.

We are currently using styleguidist and the generated html is able to open directly that way and it works with Jenkins, hope Docz is able to support that so that we could switch to it faster

Jenkins has some several restrictions about run static contents.

https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy

Seems you need to relax those restrictions to run static content properly.

The problem is not those restrictions but be able to open the generated index.html file directly instead of serve by a server

The problem is not those restrictions but be able to open the generated index.html file directly instead of serve by a server

Could you explain how are you doing that and which errors are had you taken with?

try npx docz build && open .docz/dist/index.html and you will see nothing appear on the screen.

Expected behavior: browser should render documentation just as npx docz dev

Cool, now could you open the console of your browser and share anything it printed at, please?

screenshot 2019-01-09 at 3 19 52 pm

+1 relative paths would be nice

Relative path seems like a sensible default to me, given it will also still work on any server but doesn't actually need a server just to open the HTML page in a browser.

Any progress on this ?

This is supported, check out the base param in the docs: https://www.docz.site/docs/project-configuration.

@RobinClowers

The base parameter does not support relative paths, it only supports absolute paths.

From the docs: it should always start and end with a slash.

One example use case is people being able to just open an HTML file and read some documentation that is in those HTML files, without having to install Node.js or start a server on the computer they are viewing it on.

Another is being able to serve them from a static location (e.g. network file share, or static site) where the full URL may not be known or may be variable (especially over time).

Oh, I see, I wasn't thinking about relative vs absolute, that's a fair point.

@rakannimer what is the reason this issue get closed?

This enhancement sounds good, it's maybe better to continue the discussion in a PR ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xingBri picture xingBri  路  29Comments

ohardy picture ohardy  路  24Comments

godmar picture godmar  路  24Comments

tamagokun picture tamagokun  路  23Comments

mzedeler picture mzedeler  路  31Comments