【日本語 / English】
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.
- 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>
- Paragraphs with indentations: rice with egg on top =>
yarn add novel-support.js
or
npm i novel-support.js
@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)
Provided by unpkg and jsDelivr.
<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>
novelSupport('#id', {content: 'html'});
// or
novelSupport('.class', {content: 'html'});
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.
- Google Chrome v78
- Mozilla Firefox Quantum v70
- Apple Safari v13
- Microsoft Edge Chromium Beta v78
- Opera v64
- Google Chrome v78
- Mozilla Firefox Quantum v70
- Microsoft Edge v44 (*1)
- Microsoft Internet Explorer v11 (*1)
1: Only ruby notation is supported.
yarn
yarn test
or
npm i
npm test
Translated with www.DeepL.com/Translator (free version)