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

Full width of browser window #50

Open
kmoschcau opened this issue Jan 9, 2018 · 6 comments
Open

Full width of browser window #50

kmoschcau opened this issue Jan 9, 2018 · 6 comments

Comments

@kmoschcau
Copy link

Hi, I just wanted to ask, if it's possible to get this plugin to render the markdown output to the full width of the browser window. Right now it only displays it in about 1/3 of my window width, which causes me to have to scroll sideways in the tables I create in my documents.

@maximbaz
Copy link

The width restriction comes from github-markdown-css, and those guys autogenerate the style based on current Github styling - so as long as Github itself restricts the width, it will be restricted too.

However, g:markdown_composer_custom_css property was just introduced, you can use any style you want. For example, you can add the following patch as a second stylesheet to use 100% of browser window:

.markdown-body {
  max-width: 100%;
}

@kmoschcau
Copy link
Author

That's a great start! Would it be possible to include a way to just override parts of the CSS instead of replacing it completely?

@maximbaz
Copy link

Initially I thought about it too, but in reality this works only if you are adding styles - as soon as you need to remove existing styles (for example to resolve conflicts with highlight.js) you cannot solve it with overridden parts.

...or at least I think you cannot? I may be wrong 🙂

@euclio
Copy link
Owner

euclio commented Jan 30, 2018

For now, could you just include the path to the default styles (/_static/vendor/github-markdown-css/github-markdown.css), with the caveat that this path may change?

@kmoschcau
Copy link
Author

kmoschcau commented Jan 30, 2018

I was thinking of doing something like that. The major factor that prevented me from trying it out was, that I was too lazy to look for the original to save it somewhere and just change that one line. That solution seems pretty static to me.

@maximbaz
Copy link

Yet another approach is to host the file on Github and use rawgit.com to wrap the link.

For example, @euclio's default style has the following link and it will most certainly never change:

https://cdn.rawgit.com/euclio/github-markdown-css/gh-pages/github-markdown.css

So you can put your patch to Github too, and set the following in your vimrc:

let g:markdown_composer_custom_css = ['https://cdn.rawgit.com/euclio/github-markdown-css/gh-pages/github-markdown.css', 'https://cdn.rawgit.com/path/to/my/override/file.css']

I use this same approach in a slightly different way, I forked the original github-markdown-css, added all the patches to my fork and now I just use:

let g:markdown_composer_custom_css = ['https://cdn.rawgit.com/maximbaz/github-markdown-css/gh-pages/github-markdown.css']

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

3 participants