bep / docuapi

Beautiful multilingual API documentation theme for Hugo
https://docuapi.netlify.app/
Other
750 stars 200 forks source link

Align blockquote and pre with h2 selectors #9

Closed damienstanton closed 6 years ago

damienstanton commented 7 years ago

I am having trouble with manual alignment of code blocks (blockquote and pre selectors). I simply need the vertical alignment of code blocks to match h2 headers in my markdown. Out of the box, the code blocks appear anywhere from 71 to 400 pixels below the text headers on the left. This misalignment is what I need to change.

I've tried to do this manually by adjusting the blockquote and pre margin-top values, but this is inconsistent depending on resolution/layout. I tried adding selectors to the partial layout file but it had no effect.

I also looked upstream for a solution but the only thing I could find involved adjusting the layout.erb file which is N/A in the docuapi port. Here is someone asking the same question there.

Does anyone have suggestions?

bep commented 7 years ago

There are plenty of hooks that allows you to override CSS or template content.

I'm not going to do anything about this one, but I will let this stay open for a while if anyone wants to share their knowledge.

damienstanton commented 7 years ago

Thanks! To clarify: I only see two hooks in the readme. The partials/hook_head_end.html hook, and adding styles to a styles.html forcing a manual override of the entire stylesheet. Neither of these hooks are able to correct the alignment of code blocks. Are there more that I am missing?

bep commented 7 years ago

Are there more that I am missing?

Well, it is Hugo so you can override any template, any stylesheet. So it should be possible. If you find that another "hook" would make it easier, please add it in form of a PR. But the best would be to handle this in CSS or in upstream code (i.e. Slate).