Comments (8)
Hmmm, thanks for the report. I can fix this by adding the following CSS incantation to the pre tag:
white-space: -moz-pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
white-space: pre-wrap;
But the result is kind of ugly because of where the linebreaks go. What is your suggestion exactly with the div tag? I'm not a web guy, a quick google turned up stackoverflow suggesting the CSS above but whatever works I can do.
EDIT: I'm not a web guy, left out a word there.
from elementsproject.org.
lol at the term 'CSS incantations'. I'm going to have to start using that....
I have a workable knowledge of styling and typically if something is problematic I'll wrap it in it's own tag and then specify style rules to alleviate any issue. However, it seems that there is already a special tag for code blocks. Checkout this Stack Overflow thread for more info
https://stackoverflow.com/questions/4611591/code-vs-pre-vs-samp-for-inline-and-block-code-snippets
from elementsproject.org.
Ok, I fiddled with that, but it also puts linebreaks in ugly places, and also we seem to be generating this from Markdown so I don't know that I can change the tag it generates. Instead I just manually added linebreaks at reasonable places in the Markdown source. However, I don't know how to regenerate or push the HTML to the actual site. @martindale ?
from elementsproject.org.
(Also, note that I only changed the C++ snippets -- there's one place where a commandline is too long, but that's less natural to wrap, and I don't want people accidentally pasting only the first half. So I left it alone for now.)
from elementsproject.org.
not sure how you have the website setup, but if you're hosting it on Github then you should be able to push the a commit with the updates to the website repo and have the site show the changes instantly. Anything would be an improvement at this point, I've been using the inspect feature of chromium to get the full line of code.
There's gotta be a nice way to show the full command line without having it wrap around or have weird line breaks....
from elementsproject.org.
I've played around with this a few times now, and the most minimal change I can find that offers a safe and sane way to display the whole line is this (available in ef5911d):
pre {
max-width: 700px;
overflow-x: scroll;
}
If this is acceptable, I can apply the rule across the whole site for all code samples. In the future, perhaps we might even look into something like SyntaxHighlighter.
from elementsproject.org.
awesome! did you update the website with the changes? I haven't noticed anything. Also, I think I might issue a pull request to update some stuff that's a little misguiding about the guide. I figured out what problems I have been having but there's definitely a few things that could use clarification. Great work though guys thanks so much!
from elementsproject.org.
@martindale In case you were waiting on me, I say go for it. (I still don't know how to push to the live site but I assume you will?)
from elementsproject.org.
Related Issues (14)
- Live Reload
- Contributor Guidelines HOT 1
- Quote in README.md is confusing
- Chainparams.cpp spelled wrong
- rootstock image missing HOT 1
- Localization
- TX code line runs off edge of browser window HOT 1
- update link in assets page to correct branch
- Payment protocol support HOT 4
- hexo "updates itself" when testing locally
- Indicate disk space required
- Broken link on bitmasksighash page HOT 4
- Improve your domain HOT 1
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 elementsproject.org.