-
Notifications
You must be signed in to change notification settings - Fork 4
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
SupportCustomLayout #52
SupportCustomLayout #52
Conversation
hey @Metalzoid the code looks good. But I was thinking if you add a layout to the page maybe you will be duplicating code like the html, head, body tags. You will be creating a html page inside another html at least you overwrite the index page too. I mean, the index page already have this structure:
Is it ok? So maybe the feature can include a modification in the index view too. And which is the use case you want to cover here? I mean, Why you need this feature? |
I see ! I need this feature for adding my custom navbar =) and if we specify adding this lines in the custom layouts user in the : <meta charset="utf-8">
<!-- Important: rapi-doc uses utf8 characters -->
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script> It's good for you ? |
mm I think, we can use by default the layout of the engine. Move all the code to it, and in the index view let something like this:
Then you can replace the engine layout with your layout with the code you defined. Can you understand me? Just leave in the index.html.erb file the things for making the rapidoc works. It should not depend on the client layout because it will be easy to forget. |
And the charset UTF8?? |
mm good question about the utf-8. It should not depend on the user too. Do you have any idea? I will think about it. |
Since this is code intended for developers, I don't think it will be a problem. At worst, in the docs, in the "use your own layouts" section, specify to use UTF8 in case of character display problems? |
ok, you are right. So it may be finished. I will review and merge it at the end of the day. Thank you! And please share it, much people use it much better we can do it 👍🏽 |
Deleting =
Adding =
oas_rails_controller:
include Rails url_helpers for support route_path
modify render html for include layout from configuration OAS_RAILS
configuration.rb:
attr_accessor :layout
initialize @layout to false
oas_rails_initializer :
config.layout = "application" + documentation
It's works fine for me