Skip to content

Latest commit

 

History

History
132 lines (95 loc) · 3.84 KB

README_ENG.md

File metadata and controls

132 lines (95 loc) · 3.84 KB

novel-support.js

npm version npm license npm downloads - month npm downloads - total jsDelivr Test Coverage

日本語 / English】

Overview.

This package is designed to make it easy to use the proprietary notation found on novel submission sites on a website.
The ultimate goal is to be able to make text copied and pasted from a novel submission site appear as such, just by using this package.

Features.

  • jQuery not required.
  • Can be specified en masse by class attribute.
  • Sass style management makes changes in CSS very easy.
  • Convert text containing your own notation, as found on novel submission sites, into the following
    • Paragraphs with indentations: rice with egg on top => <p class="ns_indent">Rice with egg on top</p>
    • Ruby notation (| 《》 | 《》): |卵かけご飯《Rice with egg on top》 => <ruby class="ns_ruby">卵かけご飯<rt>Rice with egg on top</rt></ruby>
    • Circle point notation: 《《Rice with egg on top》 => <strong class="ns_emphasis">Rice with egg on top</strong>

Usage.

yarn (or npm)

Installation

yarn add novel-support.js

or

npm i novel-support.js

Ready to operate

@import "node_modules/novel-support.js/dist/css/_novel-support.scss"
import novelSupport from "novel-support.js";

novelSupport('#id', {content: 'html'});
// or
novelSupport('.class', {content: 'html'});

// {content: 'html'} is optional and can be omitted (detailed in the options)

CDN.

Provided by unpkg and jsDelivr.

CDN installation

<link rel="stylesheet" href="https://unpkg.com/novel-support.js/dist/css/novel-support.css">

<script src="https://unpkg.com/novel-support.js/dist/js/novel-support.js"></script>

or

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/novel-support.js/dist/css/novel-support.css">

<script src="https://cdn.jsdelivr.net/npm/novel-support.js/dist/js/novel-support.js"></script>

Ready to operate

novelSupport('#id', {content: 'html'});
// or
novelSupport('.class', {content: 'html'});

Options.

You can specify {content} as the second argument of novelSupport().

If the target contains HTML tags, the second argument is written as {content: 'html'}. If you do not write anything, the default argument, {content: 'text'}, is applied.
If {content: 'text'}, all conversions are done; if {content: 'html'}, no paragraphing is done with indentation.

Verified Browser (npm only)

macOS Mojave v10.14.6

  • Google Chrome v78
  • Mozilla Firefox Quantum v70
  • Apple Safari v13
  • Microsoft Edge Chromium Beta v78
  • Opera v64

Windows 10 Home v1903

  • Google Chrome v78
  • Mozilla Firefox Quantum v70
  • Microsoft Edge v44 (*1)
  • Microsoft Internet Explorer v11 (*1)

1: Only ruby notation is supported.

Test.

yarn
yarn test

or

npm i
npm test

Past Changes.

CHANGELOG.md

License.

MIT

Link.

Translated with www.DeepL.com/Translator (free version)