Comments (12)
Want to take a crack at this @rwinch? It could be a good opportunity to give the extension API an exercise. I'd suggest using either a treeprocessor or postprocessor, but if you have another idea, go for it.
from asciidoctor-extensions-lab.
Sure it will be fun to play around with the extensions :)
Out of curiosity can you clarify what you mean by when a dedicated label is clicked? In the Syntax Quick Reference guide it is currently adding the link with javascript. Would this be different? Perhaps an example of what the adoc file is expected would be useful.
from asciidoctor-extensions-lab.
You have it right. I just meant that the user would click something
obvious, like view result to reveal the hidden content.
from asciidoctor-extensions-lab.
@mojavelinux I added my first draft of the extension, but I think there are still some shortcomings that probably need addressed before this becomes a PR (mentioned in the commit). Please let me know if you agree or if since this is a lab that it is ok for now.
In addition to the shortcomings listed in the commit comment, I really think it should have some tests. I noticed none of the other extensions in the lab seem to have tests though. I assume you would be ok with me adding some for this extension?
NOTE: Partially why I am asking about the tests is I'm quite the Ruby noob, so I wanted to make sure I wasn't just missing the tests (i.e. in some other repo or something).
Thanks!
Rob
from asciidoctor-extensions-lab.
Thanks @rwinch!
Since this is a lab, I don't see any problem with merging as is. I agree it would be good to have tests. I haven't had an opportunity yet to sort out what approach we should use for testing...and I'm not well-versed in Ruby-based test frameworks. If you want to give it a shot, perhaps Minitest, RSpec or Cucumber. Here's a pretty straightforward article on Minitest that just came up:
- http://www.sitepoint.com/simple-testing-ruby-using-minitest/
- http://www.sitepoint.com/minitest-shoulda/
from asciidoctor-extensions-lab.
Another possible idea for this extension (or a related one) is to have a result block that is automatically generated. This would only apply for AsciiDoc example content. The extension would copy the contents of a marked listing block and add a new example block with that content as a following sibling. Now that I spell it out, it seems best as a separate extension, perhaps "ViewAsciiDocResultTreeprocessor". It would eliminate the duplication you see in this source: https://raw.githubusercontent.com/asciidoctor/asciidoctor.org/master/docs/asciidoc-syntax-quick-reference.adoc
from asciidoctor-extensions-lab.
Given the PR is fine as is and I haven't had time to clean things up. I am going to send the PR. Hopefully in the coming weeks I can find some time to add the remaining polish.
from asciidoctor-extensions-lab.
I have added #4 along with the suggested changes for a comment about wanting to have an API for modifying the header.
from asciidoctor-extensions-lab.
I think we should merge this to encourage participation. I haven't had a chance to play with it, but I've pointed several people in this direction doing similar things. wdyt?
from asciidoctor-extensions-lab.
Thanks for the response. Please feel free to merge the PR.
from asciidoctor-extensions-lab.
Excellent! Thanks!
from asciidoctor-extensions-lab.
Hi all.
I see that this extension is merged. Nice!. Is it possible to use it from asciidoctorj? Any advice that points me into the right direction is appreciated.
I have asciidoctorj installed by SDKMAN.
Thanks.
from asciidoctor-extensions-lab.
Related Issues (20)
- Is there a configuration open for using divs instead of tables for admonitions? HOT 1
- mathoid-treeprocessor and new versions of mathoid HOT 4
- npm install mathoid error: Package libffi was not found in the pkg-config search path. HOT 2
- Convert all inline example to use create_inline otherwise it gives "INFO: expected substitution value for custom inline macro to be of type Inline" HOT 5
- Integrate asciidoc-coalescer.rb as extension/converter so as to make it available in the CLI HOT 1
- sectnum offset tree processor always returns 1 or 2 HOT 1
- Make all these extensions installable with gem install HOT 4
- generate pdf with chart block HOT 4
- adding row name to chart HOT 3
- Add a metadata object for year HOT 1
- Add metadata object for tag message HOT 2
- man-inline-macro doesn't generate the correct output in the manpage backend HOT 5
- Section offset plugin fails when creating PDF HOT 4
- Using the Preprocessor ignores ifdef directives HOT 1
- add link to the current script location as comment into the script HOT 6
- Idea: Create file tree containing all included files HOT 2
- Graduate the asciidoc-coalescer.rb script to a separate project HOT 4
- showcomments-preprocessor seems broken with latest asciidoctor HOT 2
- Create summaries from distributed definitions HOT 1
- Help With Callouts: Any Examples? HOT 5
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 asciidoctor-extensions-lab.