Numbered Headings Application

Version 33.1 by Michael Hamann on 2022/02/03 10:07

cogProvides the User Interface and CKEditor plugins for Numbered Headings.
TypeXAR
CategoryApplication
Developed by

Manuel Leduc, Michael Hamann

Active Installs2
Rating
2 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

14.0+

Installable with the Extension Manager

Description

Provides the User Interface and CKEditor plugins for Numbered Headings. This application is part of the Numbered Content Application.

Numbering Activation

From the UI

Not implemented yet. Currently in development.

From the Object Editor

To activate headings numbering on a Space or a Page, a NumberedHeadings.Code.NumberedHeadingsClass XObject can be added, and its status field set to Activated.
To deactivate headings numbering, the same steps can be followed, but the status field must be set to Deactivated.

Use Example

In the sample below, the first two header are numbered incrementally, according to their level.
Then, the third header numbering is skipped, using the data-xwiki-rendering-protected parameter (note that the data-numbered-headings-skip parameter was used instead in versions 1.0 and 1.1). Hence, the fourth header is numbered 1.1.1.
Finally, the last header is re-numbered to 10, and it full numbered is 1.10.

= Header 1 =

== Header 1.1 ==

(% data-xwiki-rendering-protected="true" %)
=== Header without number ===

=== Header 1.1.1 ===

(% data-numbered-headings-start="10" style="--numbered-headings-start: 9;" %)
== Header 1.10 ==

Template

A template named Numbered Headings Template is provided. It creates a document with numbered headings activated and a single header with a placeholder content.

CKEditor Integration

Heading Level change on Tab

When the cursor is placed on a header in the editor, pressing tab increases the header level by 1 (pressing tab on a level 6 header has no effect).
Pressing shift+tab decreases the header level by 1. Pressing shift+tab on a level 1 header replaces it by a normal text field.

Numbering deactivation

Numbers can be deactivated on a header by right-clicking on it and click one the Skip Numbering: Activate entry.
In the same way, re-activating the numbering on a header can be done by selecting the Skip Numbering: Deactivate entry.

Re-Numbering

A specific value can be forced on a header by right-clicking on a header and click on the Header Config entry. Then, a modal windows is proposed with a start field where a integer value can be defined. The entered value impact the last segment of the header. For instance, setting 10 on a level 3 header 12.5.2 will make it 12.5.10.
Leaving the field empty reset the field to the standard incremental numbering behavior.

Table of Content

See ToC Macro.

Known Limitations

XWiki <13.4-rc1 

Numbered Headings can be installed on XWiki 13.10+ but has some limitations when used on version lower than 13.4-rc-1.

Numbering Activation

Numbers cannot be activated from the UI. It is required to become and Advanced user, edit the objects of the page and add a NumberedHeadings.Code.NumberedHeadingsClass XObject and set the status field to Activated.

Numbering on WYSIWYG

While numbering works fine in the in-place editor, it is not the case when editing in WYSIWYG mode. This means that while the editor actions (level change on tab, number skipping...) will work fine, no visual feedback is shown to the user.

Numbering and groups

Using re-numbering on headers located inside groups (for instance, a div tag) does not impacts the following headers located outside of the group. In this case, inconsistent numbers can be presented and the re-numbering feature must be used manually on the first header after the group to fix the inconsistency.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Dependencies

Dependencies for this extension (org.xwiki.contrib.numbered.content:application-numbered-content-headings-ui 1.2):

  • org.xwiki.contrib.numbered.content:application-numbered-content-headings-api 1.2
  • org.xwiki.contrib:application-ckeditor-ui 1.59
  • org.xwiki.platform:xwiki-platform-localization-webjar 14.0
Tags:
    

Get Connected