Promote Nomark

This commit is contained in:
2025-11-23 17:41:35 +09:00
parent 53b8f21a7b
commit ed39e595cd
5 changed files with 20 additions and 20 deletions

View File

@@ -98,12 +98,6 @@ filter:
- Do not change the capitalization of WikiNames.
- Do not translate or rephrase WikiNames.
- Treat WikiNames as indivisible symbols, similar to `[[links]]`.
creole: |
## Markup rules
- Interpret the content as Wiki Creole.
markdown: |
## Markup rules
- Interpret the content as Markdown.
nomark: |
## Markup rules
- Interpret the content as Nomark, a custom minimal format that is mostly plain text.
@@ -117,6 +111,12 @@ filter:
In Nomark syntax, headings are written like !!! Title !!!
with three or more ! on each side. The exact count of !
characters must be preserved.
creole: |
## Markup rules
- Interpret the content as WikiCreole.
markdown: |
## Markup rules
- Interpret the content as Markdown.
image-filter:
agent: "ChatGPT"

View File

@@ -51,9 +51,9 @@ type Config struct {
Prompt string `yaml:"prompt"`
Temperature float64 `yaml:"temperature"`
Common string `yaml:"common"`
Nomark string `yaml:"nomark"`
Creole string `yaml:"creole"`
Markdown string `yaml:"markdown"`
Nomark string `yaml:"nomark"`
} `yaml:"filter"`
ImageFilter struct {

View File

@@ -23,9 +23,9 @@ type Public struct {
Prompt string
Temperature float64
Common string
Nomark string
Creole string
Markdown string
Nomark string
}
ImageFilter struct {
@@ -79,18 +79,18 @@ func Publish(cfg *Config) Public {
Prompt string
Temperature float64
Common string
Nomark string
Creole string
Markdown string
Nomark string
}{
Agent: cfg.Filter.Agent,
System: cfg.Filter.System,
Prompt: cfg.Filter.Prompt,
Temperature: cfg.Filter.Temperature,
Common: cfg.Filter.Common,
Nomark: cfg.Filter.Nomark,
Creole: cfg.Filter.Creole,
Markdown: cfg.Filter.Markdown,
Nomark: cfg.Filter.Nomark,
},
ImageFilter: struct {

View File

@@ -11,23 +11,23 @@ import (
func Detect(cfg *config.Config, text string) string {
if len(text) > 0 {
// detect markup by very first character of input text.
// * '!' : Nomark
// * '=' : Creole
// * '#' : Markdown
// * '!' : Nomark
head := text[0]
if head == '=' {
if head == '!' {
return "nomark"
} else if head == '=' {
return "creole"
} else if head == '#' {
return "markdown"
} else if head == '!' {
return "nomark"
}
}
// no headers
// Chosen by config
conf := cfg.Wiki.Format
if conf == "creole" || conf == "markdown" || conf == "nomark" {
if conf == "nomark" || conf == "creole" || conf == "markdown" {
return conf
}
@@ -46,7 +46,7 @@ func Apply(cfg *config.Config, title string, text string) (string, string, strin
} else if mode == "markdown" {
fc := markdown.ToFormatConfig(cfg)
return markdown.Apply(fc, title, text)
} else {
} else { // nomark
fc := nomark.ToFormatConfig(cfg)
return nomark.Apply(fc, title, text)
}

View File

@@ -109,6 +109,10 @@ Common =
<pre>{{.Public.Filter.Common}}</pre>
</p>
<p>
Nomark =
<pre>{{.Public.Filter.Nomark}}</pre>
</p>
<p>
Creole =
<pre>{{.Public.Filter.Creole}}</pre>
</p>
@@ -116,10 +120,6 @@ Creole =
Markdown =
<pre>{{.Public.Filter.Markdown}}</pre>
</p>
<p>
Nomark =
<pre>{{.Public.Filter.Nomark}}</pre>
</p>
<h3>ImageFilter</h3>
<p>