Comments (5)
Possible implementation:
diff --git a/source/javascripts/app/lang.js b/source/javascripts/app/lang.js
index 7f1bcdb..e5170ca 100644
--- a/source/javascripts/app/lang.js
+++ b/source/javascripts/app/lang.js
@@ -21,13 +21,14 @@ under the License.
function activateLanguage(language) {
if (!language) return;
-
$("#lang-selector a").removeClass('active');
$("#lang-selector a[data-language-name='" + language + "']").addClass('active');
for (var i=0; i < languages.length; i++) {
$(".highlight." + languages[i]).hide();
+ $(".desc." + languages[i]).hide();
}
$(".highlight." + language).show();
+ $(".desc." + language).show();
}
function setupLanguages(l) {
from slate.
I added this for the tutorial I'm working on. If there's a better way, I'd be interested to know.
from slate.
Updated implementation to use simple tags. I had to modify the CSS a bit because slate wasn't happy that the content existed inside a span.
from slate.
Hmm, I can take a closer look at this this week. I think if we make everything have the same class, that would be faster, since it means jQuery doesn't have to search over the entire page twice.
from slate.
In a similar way to the suggestion by @bootstraponline, we've ended up implementing a lang-specific
class, which you can use like this:
<p class="lang-specific ruby shell">
only show for ruby and shell languages
</p>
To use this feature, you need to write HTML instead of markdown, but we expect that this will be a rare-enough feature that this is an okay compromise.
from slate.
Related Issues (20)
- Heroku deployment
- Success redirect
- EMFILE, possible file handler leak
- Difficulty implementing on Windows machine HOT 1
- Difficulty implementing on Windows machine in both approach (ruby & docker as well) HOT 3
- Search function not finding results HOT 2
- [email protected]
- lang specific blockquotes weird behavior. HOT 2
- no implicit conversion of Hash into Integer HOT 1
- bundle exec middleman server: have error
- diff ruby version HOT 1
- Build with Docker should create a build folder with current owner user instead of root HOT 3
- unable to configure the slate set up in windows HOT 1
- UniqueHeadCounter not working when deploying with Docker HOT 1
- Update Invoice API documentation HOT 2
- editable re-render cause the cursor to be brought forward in composing events.
- ddd
- i got /usr/bin/env: ‘bash\r’: No such file or directory when i run the container
- Incorrect Section Highlighted in TOC When Near End Of Page
- Window middleman command fail
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slate.