1.1.2 • Published 3 years ago

qa.js v1.1.2

Weekly downloads
24
License
MIT
Repository
github
Last release
3 years ago

QA.js

this package is used to generate JSON-LD (structured data) and HTML for question-and-answer from json source file.

How to Install

npm install -g qa.js

How to Use

qa source.json > result.html

JSON source

[
  {
    "header": "some header",
    "questions": [
      {
        "question": "bla bla bla?",
        "answer": [
          "bla bla [bla](https://www.google.com)",
          "**bla** bla bla",
          "bla *bla* bla"
        ]
      },
      {
        "question": "bla bla bla?",
        "answer": ["bla bla bla"]
      }
    ]
  }
]

Result

<script type="application/ld+json">
[
    {
        "@context": "http://schema.org/",
        "@type": "Question",
        "text": "bla bla bla?",
        "acceptedAnswer": {
            "@type": "Answer",
            "text": "bla bla bla\nbla bla bla\nbla bla bla"
        }
    },
    {
        "@context": "http://schema.org/",
        "@type": "Question",
        "text": "bla bla bla?",
        "acceptedAnswer": {
            "@type": "Answer",
            "text": "bla bla bla"
        }
    }
]
</script>

<section>
    <h3>some header</h3>
    <section>
        <h4>Tanya: bla bla bla?</h4>
        <p>Jawab: bla bla [bla](https://www.google.com)</p>
        <p>**bla** bla bla</p>
        <p>bla *bla* bla</p>
    </section>
    <span style="text-align: center;">----------</span>
    <section>
        <h4>Tanya: bla bla bla?</h4>
        <p>Jawab: bla bla bla</p>
    </section>
    <span style="text-align: center;">----------</span>
</section>
1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago