Git Product home page Git Product logo

expounder's Introduction

Expounder

Expounder is a small JS library that implements a concept I had for adaptable experience levels in educational texts. In more concrete terms, expounder allows authors of tutorials to hide their explanations if they expect readers to be familiar with a concept. The author can choose to add a link to the concept, which will appear underlined, and the reader can click on it to expand the next few sentences, paragraph or any other element that explains the concept.

This way, people familiar with a term don't need to spend a paragraph reading about it or waste time (and potentially miss other useful information) skimming ahead. You can see an example in the examples directory, on the Expounder page or on one of my posts.

Here's a demo GIF, from the Expounder page:

Usage

Expounder.js can be added to your site in two simple steps:

  1. Download and include expounder.js and expounder.css (or the minified version, for production) in your page. Alternatively, just add these two lines to your HTML:
    <script src="https://cdn.jsdelivr.net/gh/skorokithakis/expounder@master/expounder.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/skorokithakis/expounder@master/expounder.css" />
  2. Add data-expounderwith arbitrary IDs for span elements that will act as hooks that expand areas, and data-expounded for the areas to be expanded.

For example:

In the land of Mordor, in the fires of <span data-expounder="mount-doom">Mount
Doom</span>, the Dark Lord Sauron forged in secret, a master ring, to control
all others.

<div data-expounded="mount-doom">Mount Doom is that big-ass mountain over there
with the fires coming out of it.</div>

If you want the links to be collapsible again after they've been clicked, you can include the script with data-default-collapse="true" in the script tag (see the examples/ dir for usage), though this is discouraged for usability.

License

This library is released under the MIT license (see the LICENSE file).

Thanks

Thanks go to:

  • Stelios, who wrote the code for the entire thing.

Changelog

  • 0.0.3 -- 4/3/2016 Updated the API, added the ability to expand every element with the same data-expounded id from a single expounder link.
  • 0.0.2 -- 4/1/2016 Added contract option with data-expounder-c attribute.
  • 0.0.1 -- 3/13/2016 Initial release.

expounder's People

Contributors

alexcasalboni avatar efine avatar luciandex avatar skorokithakis avatar stelabouras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

expounder's Issues

Suggestions.

Awesome! My writing style can sometimes br... regrettably verbose. Huge walls of text arr daunting to the reader, and inevitability distract. This could be perfect for allowing me to expound upon a point without overwhelming the reader, to offer an aside which may not be critical to understanding the poking I'm making, but is tangentaly relevevant. Anyway... I really like this :)

Just trying the demo, the interaction feels very natural, unencumbering. It's got a nice UX flow. However, I think that it might be a good idea to offer some stronger visual cues to someone who perhaps doesn't realize that the underlined text means it will expand. Because it's in-line, your styling options are rather limited (so it doesn't mess up the spacing). Perhaps a small icon inline, or better yet a tooltip. You could even have it appear partially for a few seconds without hovering just so that the user knows there is a potential interaction.

So that's the first suggestion. The second: considered making the expanded yext distinguishable from the main body. Italics, a light grey background, smaller font with a heaver weight and lightened text color are all subtle things that could go a long way. Maybe one style could even reveal a block quote as apposed to a inlined text.

And finally, there should be some way to collapse the text. I tried double tapping the expounded text expecting it to collapse, de-clutter the screen. If attempted that instinctually, I'm sure others will as well.

Any way, awesome concept. Would line to hear your thoughts smoky my suggestion. I'll be certain to PR this ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.