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

Multiple languages by tab #55

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Multiple languages by tab #55

wants to merge 9 commits into from

Conversation

maelle
Copy link

@maelle maelle commented May 11, 2020

Fix #54

I realize this PR is not very elegant yet.

The body data attributes are now a list of all languages including "otherlangs", and a list by tab of languages to go with the main language.

<body class="index" data-languages='[ &#34;go&#34; ,  &#34;java&#34; ,  &#34;javascript&#34; ,  &#34;python&#34; ,  &#34;ruby&#34; ,  &#34;shell&#34; ]'  data-withgo='[ &#34;go&#34; ]' data-withshell='[ &#34;shell&#34; ]' data-withruby='[ &#34;ruby&#34; ]' data-withpython='[ &#34;python&#34; ]' data-withjavascript='[ &#34;javascript&#34; ,  &#34;java&#34; ]'>

It now works

  • in the JavaScript tab one sees both Java and JavaScript,

  • JSON is in all tabs.

@maelle

This comment has been minimized.

@maelle

This comment has been minimized.

@maelle maelle marked this pull request as draft May 11, 2020 17:50
@maelle
Copy link
Author

maelle commented May 12, 2020

In this PR there is now

  • tweaks to baseof.html to store more data attributes related to languages.
  • changes in _lang.js to show more than one language per tab
  • changes in exampleSite to exemplify the features
  • changes in the styles.html partial to be able to add custom CSS because I couldn't find a variable to override to add some margin before pre elements.

I'm not sure whether any of this might be useful to add to the theme, but if some of it is, happy to incorporate feedback & to document stuff.

@maelle maelle marked this pull request as ready for review May 12, 2020 09:56
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

Successfully merging this pull request may close these issues.

Multiple languages by tab?
1 participant