Coder Social home page Coder Social logo

kookma / tw-section Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 3.0 4.66 MB

create, edit and manage big and lengthy tiddlers through sectioning

Home Page: https://kookma.github.io/TW-Section/

License: MIT License

CSS 100.00%
tiddlywiki5 plugin section section-editor

tw-section's Introduction

Section Editor plugin

Sectionize big tiddlers on headings, edit in place, create, fold and manage sections.

Create patchwork tiddlers, to weave the fragments together to present narrative stories.

Code and demo

For learning plugin features, syntax, tutorial and examples see the plugin demo and code pages

tw-section's People

Contributors

kookma 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

Watchers

 avatar  avatar

tw-section's Issues

Demo is one version ahead of github code ?

It appears that the github code is at version 1.1.1, but the Demo is at 1.1.2. And there appears to be a slight bug in the presentation of previews in 1.1.1. The demo version appears to be condensed (uglified?), so it's not easy to work with.

Would it be possible to update the code base to 1.1.2 ?

Thank you!

Compatibility issues with checklist plug in

I tried using section editor with checklist plug in. But the checklist doesn't work once i add the "se-type" field in that tiddler.

"Ticked" todos get "unticked" automatically, if I close and re-open that tiddler or if I edit that tiddler. Sometimes it shows "Internal JavaScript Error " warning also.

Also the sections and checklist items gets jumbled when the checklist is ticked if I don't add a line before the checklists.

Any idea what is causing this behaviour? I have attached a demo wiki

Section and checklist.html.zip

Add list-after field to $:/plugins/kookma/section/viewtemplates/sections

The list widget uses the list-after field to control the order of tiddlers in <$list>. I suggest that $:/plugins/kookma/section/viewtemplates/sections should add this field so that list-after has the value $:/core/ui/ViewTemplate/body to indicate the Section's ViewTemplate immediately after the tiddler's body.

Without adding this field, Sections are sometimes listed after other custom ViewTemplates, such as CrossLinks:

image

After adding list-after field:

image

Overwrite others sections in case there is an empty section title

it might be a really wired situation.

Step to reproduce this bug

  1. Go to website: https://kookma.github.io/TW-Section/ and create a new tiddler
  2. modify tiddler title to Section editor test add a new field se-type, and save this tiddler.
  3. Edit this tiddler and add content
!! Section 1

S1

!! 

There is a space in the empty section title.

image

  1. Save this tiddler

image

  1. Edit the second empty section add content
!! Section 2
S2

image

  1. Save the section and the content changes into
!! Section 2

S2Section 1

S1

!! Section 2

S2

image

The content in Section 1 is messed up.

I can confirm it is only happening when editing a section with empty title (i.e. !! )

Set sections to collapse by default?

Is it possible to flag a section as "collapsed by default", so when the Tiddler is loaded that section will initially appear collapsed?

If this feature is not available, please consider this to be a feature request. πŸ˜ƒ

If this feature IS available, it is not obvious in the documentation.

Thanks!

Plugin Status: required tiddlywiki version differs

According to the Plugin Status of the Section Editor Plugin v1.2.0 the Tiddlywiki version 5.2.0+ is required.

I have noticed a difference to the required tiddlywiki version of the Section Editor itself:

{{$:/plugins/kookma/utility!!core-version}} is >=5.2.5

So I am not sure, which version of Section Editor can be used with Tiddlywiki v.5.2.1 πŸ€”

Edit:
A similar issue applies to the Utility Plugin

Use state tiddler

Hi, Is it possible use $:/state/section-editor/xxx instead of $:/section-editor/state/xxx?

So they won't be committed to the git...

CSS white-space: pre-wrap setting inserts lots of whitespace in se-type

When writing my tiddlers, I like to use Semantic-linebreaks in my tiddlers:

I have a tag called "hardlinebreaks" that I enable to force this in TW without resulting to triple-quotes.
I like to read my .tid files in text form, so wrapping everything in """ is quite noisy.

I've recently come across your TW-Section plugin and I'd really like to start utilizing it.
Although, it (appears) to insert many blank lines into the tiddler.
This makes the hardlinebreaks rendering somewhat unreadable due to the extra whitespace.
An example where I tried this out is below:

Note: the above is my current playground for it, so it may or may not have the example settings for hardlinebreak tag and the se-type field

I can start poking around in the source to see if this is something I can find and fix,
but I thought I'd reach out to you first to see if you had any quick tips.

Hope this can work with markdown tiddlers

ζˆͺ屏2021-11-04 上午1 07 21

I'm using fishing plugin to incremental reading materials from the internet, but web-clipper can only download markdown materials, so I have some md tiddlers in my wiki.

Hope Section editor can work with them too!

Wrong this.editTitle in a section

We have a fishing plugin https://github.com/oflg/fishing that you may know. We use this.editTitle to get current article tiddler's title, and add the a article title as tag for the flashcard.

But currently, in a section, the this.editTitle will be wrong, seem to be changed to the first line section?

Update plugin library

Hi Mohammad, seems you forget to update your plugin library, and I have been waiting for your update for a while...

Feature suggestion: use custom filter to split sections

Hello! Earlier in the TiddlyWiki Talk, I mentioned that I would like to be able to segment tiddlers not only based on first and second-level headers, but also in a more flexible way. After that, I tried to write a custom filter to achieve this.

First, add a new tiddler to define the new filter:

/*\
title: $:/core/modules/filters/sectionsplit.js
type: application/javascript
module-type: filteroperator
author: Gk0WK(nmg_wk @yeah.net)

Split sections of wikitext

\*/
(function() {

    /*jslint node: true, browser: true */
    /*global $tw: false */
    "use strict";

    /*
    Export our filter function
    */
    exports.sectionsplit = function(source, operator, options) {
        var options = {};
        operator.operand.split('+').forEach(option => {
            options[option] = true;
        })
        var results = [];
        source(function(tiddler, title) {
            var section = [];
            title.split('\n').forEach(line => {
                var newSection = false;

                if ((options.all || options.h1) && /^!\s+[^\n]+$/.test(line)) {
                    newSection = true;
                } else if ((options.all || options.h2) && /^!!\s+[^\n]+$/.test(line)) {
                    newSection = true;
                } else if ((options.all || options.h3) && /^!!!\s+[^\n]+$/.test(line)) {
                    newSection = true;
                } else if ((options.all || options.h4) && /^!!!!\s+[^\n]+$/.test(line)) {
                    newSection = true;
                } else if ((options.all || options.h5) && /^!!!!!\s+[^\n]+$/.test(line)) {
                    newSection = true;
                } else if ((options.all || options.h6) && /^!!!!!!\s+[^\n]+$/.test(line)) {
                    newSection = true;
                } else if ((options.all || options.hr) && /^---+$/.test(line)) {
                    newSection = true;
                } else if ((options.all || options.blank) && /^\s*$/.test(line)) {
                    newSection = true;
                }

                if (newSection && section.length > 0) {
                    results.push(section.join('\n'));
                    section = [];
                }
                section.push(line);
            });
            results.push(section.join('\n'));
        });
        return results;
    };

})();

This toddler also has:

  • type: application/javascript
  • module-type field: filteroperator
  • title: $:/core/modules/filters/sectionsplit.js

Then, change the filter expression in line 11 of source/section/macros/main.tid to [<sourceText>sectionsplit[h1+h2+h3]!is[blank]regexp<nonWhitespace>].

Then TW-Section can split toddler by h1, h2 and h3. You can change it to [h1+h2+h3+h4] and so on to take more split rules. Now this filter support:

  • h1 ~ h6
  • hr
  • blank, means blank line
  • all, means all above

If you think this filter is useful, I can add more rules to it. πŸ˜„

Conflict with tiddlywiki/freelinks plugins

System information: Latest TW section after tiddlywki 5.2.2 with node.js 2.0.16 under windows 10

Step to reproduce this bug.

  • Enable "tiddlywiki/freelinks" in the file tiddlywiki.info.
  • Edit the non-first section/subsection in a tiddler (the first section is working).
  • Type any character in the editor.
  • The edit area will loss focus and cannot type any new characters.

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.