Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

create a specialized parser based on markdown#803

Unanswered
azu asked this question inQ&A
Discussion options

azu
Jul 20, 2021
Maintainer

Hello! My name is Micah. I am looking to create a specialized parser based on markdown. We have a documentation system that takes in markdown and spits out html. BUT, we have a few custom tags in the mix. Currently, we have no linter, so I am looking to bring some automation and error checking into the mix. Here's an example:

Use the code snippet below and plug in your API key. The API key is available on your **Organization Settings** page, on the **APIs** tab. The API key is of type `sdk`. For more information, see [Understanding API Keys](https://help.example.com/hc/en-us/articles/API-keys).<div>{{# tab label="Java" }}` ` `javaimport com.example.FactoryBuilder;import com.example.Client;import com.example.ClientConfig;import com.example.Factory; ClientConfig config = ClientConfig.builder()   .setBlockUntilReadyTimeout(10000)    .build(); Factory factory = FactoryBuilder.build("YOUR_API_KEY", config);Client client = factory.client();try {    client.blockUntilReady();} catch (TimeoutException | InterruptedException e) {    // log & handle }` ` `{{/ end }}</div>Now you can start asking the SDK to evaluate treatments for your customers.# Using the SDK ## Basic useUse an if-else-if block as shown below and insert the code for the different treatments that you defined in the UI. Remember the final else branch in your code to handle the client returning the [control treatment](https://example.com/hc/en-us/articles/Control-treatment).

(Above I have spaces between backticks. In real life, the spaces wouldn't be there)

Ideally, everything between

and
(inclusive) would be part of an HTML block. I really just need to match the div tags. Then, I can make sure that the {{#tab}} and {{/end}} match.

Right now, as soon as it hits the newline inside the HTML, it switches to paragraph:

image

Any help is much appreciated! Thanks.

Originally posted by@dogeared in#752 (comment)

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

azu
Jul 20, 2021
Maintainer Author

📝 I've moved it to new thread.

I am looking to create a specialized parser based on markdown.

Probably, you need to create custom textlint plugin for your customized markdown format.

textlint's built-in@textlint/textlint-plugin-markdown isremark-based parser.

Right now, as soon as it hits the newline inside the HTML, it switches to paragraph:

remark make same result, but I feel that is a bit strange.
https://astexplorer.net/#/gist/cf9d6c826c676bb43aab62cf0485e381/7034648b895eda0c60ca152c853a5e90ca1c92a2

You must be logged in to vote
1 reply
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@azu
Converted from issue

This discussion was converted from issue #802 on July 20, 2021 06:29.


[8]ページ先頭

©2009-2025 Movatter.jp