User talk:The Transhumanist/OutlineViewConventional.js


 * This script is under development, and is not yet functional

When completed, this script will change the viewed formatting of the current outline into that of a conventionally indented outline, without headings. A textual tree; that is, an indented item list.

= Script's workshop =
 * This is the work area for developing the script and its documentation. The talk page portion of this page starts at, below.

Description / instruction manual for

 * This script is under development, and is not yet functional

When completed, this script will change the viewed formatting of the current outline into that of a conventionally indented outline, without headings. A textual tree; that is, an indented item list.

General approach
(general approach goes here)

More specifically, starting at the beginning...

Desired/completed features

 * Completed features are marked with ✅

Development notes for
Article format has headings, conventional outline format does not. The challenge is to convert back and forth. Therefore, the heading information must be saved somehow so that headings can be restored as needed. That could be done by adding class names during the initial regex operation. Also, there are the opening and closing tags.

The heading/lead item pairs are a problem, because they have to be integrated into one for the conventional view, and restored to duality for the article view.

This script needs to work with the other view mode scripts.

Rough rough talk-through
Change, , ..., tags to , , ...,

To do this, use regex with outerhtml to change the whole item. That way, you can get the closing tag in the same search/replace.

Reversing it will be the same type of operation.

This is similar to injecting  tags, like in OutlineViewAnnotationToggler.js:

Like this:

To change them back, you reverse the process:

Script dependencies
= Discussions =


 * This is where the actual talk page starts for User:. Please post your discussion threads below...

Script to convert headings to list items (and back again) in outlines
Outlines (e.g., Outline of Japan) are essentially big long bullet lists broken up by headings.

I'd like a viewing script (that does not edit the page's saved wikicode), that does the following to viewed outlines:

On "Outline of" pages only, I'd like a menu item toggle that converts the headings so that they are integrated into the overall bullet list on the page, as list items. Clicking the menu item again would turn the page back to normal (to heading format). Like my other scripts, the status should be remembered between pages (so that all outlines get viewed the same way).

When turned on, the page's content will be one long indented bullet list. H2 headings would be converted to list items with one bullet, H3 with two bullets, etc. The subsection edit link should be retained.

Any bullet item trees beneath a converted heading would have to also be adjusted to start out with one more bullet than the heading they belong to, otherwise, the level indications will be off.

I started picking away at this project in User:The Transhumanist/OutlineViewConventional.js, but have realized it is way beyond my skill level. The Transhumanist 23:34, 3 December 2017 (UTC)
 * That does seem a bit complicated. If I understand correctly, you want to do the following sort of transformation to the page html:


 * If so, then the basic approach would be to get all the content between heading tags of the same level, and wrap it inside list tags like  and   (doing the same for all headings on the page). Going back would be a matter of moving the heading text back into appropriate heading tags, and removing the added   and   tags (but not the original content). Does that give you some ideas? - Evad37 &#91;talk] 08:52, 5 December 2017 (UTC)
 * I missed the li part. Thank you. By the way, what about the rest of the bullets? Will their indents be adjusted automatically? The Transhumanist 05:04, 6 December 2017 (UTC)
 * Yes, indentation is automatic - Evad37 &#91;talk] 05:52, 6 December 2017 (UTC)
 * Thank you. The Transhumanist 12:05, 7 December 2017 (UTC)