Dynamic content filtering in org-mode exported HTML documents based on tags.

Related tags

Editors emacs org-mode
Overview

Dynamic tag filtering in org-mode exported HTML documents

This JavaScript code adds dynamic tag filtering to HTML documents exported from Emacs Org-mode. It allows to hide/reveal page content based on tags and TODO-keywords, which may be useful for larger documents like journals, all-in-one notes files, etc. Of course, it will not be useful at all if you are not using any tags or TODO-keywords in your org files.

Author's use case: I have a growing journal of notes which is automatically published as HTML to a private web space. When looking back at stuff or looking for something specific, I find it useful to be able to filter the page to specific content (and hide the rest).

Screencast

Screencast

The CSS for the screencast document can be found here: https://sandyuraz.com/blogs/orgmode-css/

Usage

Include the script in exported HTML documents by adding the following Org-mode line to your org files:

#+HTML_HEAD_EXTRA: <script src="https://cdn.jsdelivr.net/gh/oyvindstegard/ox-tagfilter-js/ox-tagfilter.js"></script>

Alternatively you can set the org-mode variable org-html-head-extra and include the <script>.. tag there, or just include it anywhere in documents really.

You may also copy the ox-tagfilter.js file to your own hosting and change the URL as appropriate, if you dislike the dependency on jsdelivr.net.

If the HTML document has exported tags or TODO-keywords in it, you should see the values appear as buttons on the top. Click those to filter the content dynamically. Press the ESC key to clear all selected buttons and show all content.

As you filter the content, the set of available filters are reduced, so that you can avoid selecting combinations that match nothing.

Demo (test documents)

The following HTML documents have been exported from test.org using Org mode with completely default configuration and only changing the doctype settings:

Compatibility

The script is compatible with the most common HTML doc-type flavours that Org-mode supports. This includes html5 (including "fancy" variant) and xhtml-strict.

In general, the JavaScript code only works in modern web browsers.

You might also like...

Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.

This project isn’t maintained anymore Please check out this fork. wysihtml5 0.3.0 wysihtml5 is an open source rich text editor based on HTML5 technolo

Jan 7, 2023

A browser based code editor

A browser based code editor

Monaco Editor The Monaco Editor is the code editor which powers VS Code, with the features better described here. Please note that this repository con

Jan 3, 2023

Lightweight UI components for Vue.js based on Bulma

Lightweight UI components for Vue.js based on Bulma

Buefy is a lightweight library of responsive UI components for Vue.js based on Bulma framework and design. Features Keep your current Bulma theme / va

Jan 4, 2023

Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.

This project isn’t maintained anymore Please check out this fork. wysihtml5 0.3.0 wysihtml5 is an open source rich text editor based on HTML5 technolo

Dec 30, 2022

A browser based code editor

A browser based code editor

Monaco Editor The Monaco Editor is the code editor which powers VS Code, with the features better described here. Please note that this repository con

May 17, 2021

Typewriter is a simple, FOSS, Web-based text editor that aims to provide a simple and intuitive environment for you to write in.

Typewriter Typewriter is a simple, FOSS, Web-based text editor that aims to provide a simple and intuitive environment for you to write in. Features S

May 24, 2022

A file based wiki that uses markdown

A file based wiki that uses markdown

wikmd What is it? It’s a file-based wiki that aims to simplicity. The documents are completely written in Markdown which is an easy markup language th

Jan 2, 2023

Browser-based code editor created to edit local or server files online

Browser-based code editor created to edit local or server files online

notIDE Browser-based code editor created to edit local or server files online. Features Autosave while editing Syntax highlight using ace editor Creat

Nov 21, 2022

Get warnings and error messages in monaco editor based on a unified processor.

monaco-unified Get warnings and error messages in monaco editor based on a unified processor. Installation npm install monaco-unified Usage First, cre

Nov 4, 2022
Comments
  • Searching outside current page (index/sitemap)

    Searching outside current page (index/sitemap)

    Hi, Thanks again for implementing this!

    AFAIU, the code currenly works only on current html page. It would be great to add an ability to search across the whole website if index/sitemap are available.

    WDYT?

    opened by yantar92 2
Releases(release-0.4)
  • release-0.4(Nov 22, 2022)

  • release-0.3(May 22, 2022)

  • release-0.2(May 1, 2022)

    • Add support for TODO-keywords in documents. If present, they will work the same way as tags and can also be combined with tags.

    • Disable filter buttons for which tags are not present in filtered content. This prevents user from selecting combinations which lead to no shown content.

    • Sort filter buttons alphabetically. A stable order of filters leads to better usability. This also has the effect of grouping TODO-keyword filters together, since they are typically all uppercase.

    Source code(tar.gz)
    Source code(zip)
Owner
Øyvind Stegard
Experienced Java developer in web tech - backend, search, security and architecture. GNU/Linux powered.
Øyvind Stegard
Ace (Ajax.org Cloud9 Editor)

Ace (Ajax.org Cloud9 Editor) Note: The new site at http://ace.c9.io contains all the info below along with an embedding guide and all the other resour

Ajax.org B.V. 25.2k Jan 4, 2023
A JS library for building WYSIWYG editors for HTML content.

For information on the ContentTools 2.x roadmap please view the: Roadmap repo ContentTools A JS library for building WYSIWYG editors for HTML content.

getme 3.9k Jan 8, 2023
Raptor, an HTML5 WYSIWYG content editor!

Raptor Editor Raptor Editor is a user-focused extensible WYSIWYG website content editor - check out the Demo. It is designed to be user and developer

PANmedia 533 Sep 24, 2022
Example VS Code plugin that uses embedded Omega Edit bindings to generate content

Ωedit Edit for VS Code Example VS Code plugin that uses embedded Omega Edit bindings to generate content. Build Requirements Bindings compiled against

Concurrent Technologies Corporation (CTC) 2 Nov 17, 2022
Pure javascript based WYSIWYG html editor, with no dependencies.

SunEditor Pure javscript based WYSIWYG web editor, with no dependencies Demo : suneditor.com The Suneditor is a lightweight, flexible, customizable WY

Yi JiHong 1.1k Jan 2, 2023
The next generation Javascript WYSIWYG HTML Editor.

Froala Editor V3 Froala WYSIWYG HTML Editor is one of the most powerful JavaScript rich text editors ever. Slim - only add the plugins that you need (

Froala 5k Jan 1, 2023
Convert json data from editorjs to html elements

EditorJs Data Parser Easyly convert json data from editorjs to html elements Installaton npm i editorjs-data-parser yarn add editorjs-data-parser Supp

Teymur Salimzade 7 Aug 30, 2022
Export HTML to word (.docx) only by browser (currently in beta) 🎉

editor-to-docx Export rich-text editor content as word file (.docx) by browser ?? . English | 简体中文 Demo online demo Snapshot Architecture This project

han 15 Oct 21, 2022
A lightweight HTML and BBCode WYSIWYG editor

SCEditor v3.1.1 A lightweight WYSIWYG BBCode and XHTML editor. For more information visit sceditor.com Usage Include the SCEditor JavaScript: <link re

Sam 566 Dec 23, 2022
A web-based tool to view, edit, format, and validate JSON

JSON Editor JSON Editor is a web-based tool to view, edit, format, and validate JSON. It has various modes such as a tree editor, a code editor, and a

Jos de Jong 10.1k Jan 4, 2023