Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails template using absolute paths makes checking on local more difficult #146

Closed
CodeMeister opened this issue Dec 10, 2020 · 12 comments
Closed

Comments

@CodeMeister
Copy link

The rails template in 2.0.2 is using absolute paths for resources and pages:

<link rel="stylesheet" href="/css/main.css"...

This works great for a web-server, but it's a problem when developing and you want to check the documentation by loading index.html directly in a browser.

Will you consider reverting the paths to be relative again?

@p8
Copy link
Member

p8 commented Dec 11, 2020

@CodeMeister to run it locally as a rack app you can run the following command:

  rackup config.ru

Turbolinks 5 requires these paths to be absolute. Maybe things will change in Turbolinks 6

@CodeMeister
Copy link
Author

@p8 That makes sense. Many thanks for the quick response 👍

@sofianegargouri
Copy link

Hi !
So we're not able to load HTML directly anymore ?
We're currently hosting our doc on Github Pages so we have a prefix in the URL path. Are we not able to do that anymore ?

@p8
Copy link
Member

p8 commented Feb 14, 2021

@sofianegargouri Maybe it would work if change the rel_prefix to your prefix..
https://github.com/zzak/sdoc/blob/master/lib/rdoc/generator/template/rails/_head.rhtml#L6

@DiegoOrejuela
Copy link

@p8 but this break turbolinks, no?

@DiegoOrejuela
Copy link

okey, I already checked change the rel_prefix and works except what solves #135 . Everything as expected. However, perhaps a setting can be added to determine whether the user wants to use the rel_prefix or not, taking into account its pros and cons. @p8 what do you think?

@p8
Copy link
Member

p8 commented Feb 25, 2021

@DiegoOrejuela Sounds good!

@DiegoOrejuela
Copy link

@p8 is it open to PR?

@p8
Copy link
Member

p8 commented Feb 25, 2021

@DiegoOrejuela
Copy link

@p8 Well, I have some bad news. Actually in local it does not work. It worked for me because I had not noticed that when I open the index from Rubymine what it does is serve it in a kind of server, but when going directly to the file in my file system it fails. So I decided to create a simple rake server to serve it, following the example of the config.ru in this gem. With this, then I don't really see the 'rel_prefix' thing working. Thank you anyway.

@p8
Copy link
Member

p8 commented Mar 1, 2021

@DiegoOrejuela Thanks for having a look. 👍 I'll try to have a stab at it as well..

@zzak zzak reopened this Jun 11, 2021
@p8
Copy link
Member

p8 commented Jan 8, 2022

The latest release uses relative paths making it work locally as well.
Locally the sidebar doesn't work but this should be fixed in: https://github.com/zzak/sdoc/pull/182

@p8 p8 closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants