Comments (9)
My intuition is that yes, we should copy them because the user is going to expect the output to look almost just like the copied code (minus prompts)
from sphinx-copybutton.
Also I can't figure this out, but in this repository I used:
copybutton_prompt_text = ">>> |\\\\$ |\\[\\d*\\]: |\\.\\.\\.: "
which appears to work fine.
but in aiida I've had to use:
copybutton_prompt_text = '>>> |\\\\$ |In \\\\[\\\\d\\\\]: |\\\\s+\\.\\.\\.: '
with the tonnes of backslashes, but this is what works
from sphinx-copybutton.
See: https://325-77234579-gh.circle-artifacts.com/0/html/intro/tutorial.html
from sphinx-copybutton.
god I hate regexes 😆
from sphinx-copybutton.
Dear Chris,
first things first: Thanks for your excellent work on this Sphinx addon, it really saves us.
We want to report back about what @chrisjsewell originally reported here. Apparently, we are getting tripped by this as well. For example, the code block at [1] will not get copied "as-is", all empty lines are missing. The config entries within conf.py
we are currently using can be reviewed at [2].
Are we missing any respective configuration option here? Otherwise, do you see an easy way to make sphinx-copybutton pass through empty lines?
With kind regards,
Andreas.
[1] https://crate.io/docs/python/en/latest/sqlalchemy.html#tables
[2] https://github.com/crate/crate-docs-theme/blob/0.15.1/src/crate/theme/rtd/conf/__init__.py#L112-L115
from sphinx-copybutton.
I'm not quite sure where the fix needs to be for this unfortunately, and haven't had time to dig into the code to figure it out. If you or anybody else wants to take a look I am happy to review PRs! (maybe @sappelhoff has run into this issue too?)
from sphinx-copybutton.
Thank you for the quick response. I tried to find the spot and handed in a corresponding patch with #127, and, optionally #128.
from sphinx-copybutton.
(maybe @sappelhoff has run into this issue too?)
I haven't (yet), but I am glad that @amotl prepared a patch (and I would vote for making copying empty lines the default)
from sphinx-copybutton.
Thank you Stefan, appreciate it. Both bringing in the feature as well as making copying empty lines the default behavior have now been folded into #127.
from sphinx-copybutton.
Related Issues (20)
- Modularize our documentation a bit HOT 1
- Copy button stays put sometimes when other objects shrink its container
- Copy button does not show up for productionlist HOT 1
- issue to store media HOT 1
- Post message after all copy buttons added HOT 3
- Build failed for config doc when importing an extension sphinx_copybutton HOT 4
- Failed build in RTD for extension sphinx-copybutton
- Copybutton disappears too quickly if you click copy then move the cursor off the code cell
- Conflict between regex exclusion/prompt selection and copybutton_exclude HOT 12
- Add Trailing New Line to Clipboard Option HOT 1
- Blank Lines Stripped from code
- Use only one tooltip HOT 2
- newline ignored when using emphasize-lines HOT 1
- Copy button not shown on some pages HOT 3
- Example Not Functional HOT 2
- Add expand button for some block elements HOT 1
- Stripping ellipsis HOT 1
- URL to copy-button.svg is incorrect because DOCUMENTATION_OPTIONS.URL_ROOT is undefined HOT 3
- Default regular expression for the copy button fails for double digit ipython cells
- Only copy lines with `.gp` class
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 sphinx-copybutton.