Skip to content

Commit 825f76a

Browse files
Merge pull request #971 from dynamsoft-docs/preview
llms.txt and minor update
2 parents 67e8b9c + b900c7e commit 825f76a

9 files changed

Lines changed: 98 additions & 64 deletions

File tree

_articles/extended-usage/dynamsoft-service-configuration.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The Dynamic Web TWAIN Service is the core piece of Dynamic Web TWAIN. It handles
1515

1616
## Installation of Dynamic Web TWAIN Service
1717

18-
On a desktop, when a new user accesses a web page using Dynamic Web TWAIN SDK for the first time, he will be prompted to install the Dynamic Web TWAIN Service. This is a built-in behavior of the library. The prompt will display the download link. Once the installer is downloaded, the installation process will take just a few seconds.
18+
On a desktop, when new users access a web page using Dynamic Web TWAIN SDK for the first time, they will be prompted to install the Dynamic Web TWAIN Service. This is a built-in behavior of the library. The prompt will display the download link. Once the installer is downloaded, the installation process will take just a few seconds.
1919

2020
The prompt comes up when you try to [create a WebTwain instance](/_articles/extended-usage/advanced-initialization.md#instantiating-webtwain-without-onwebtwainready).
2121

@@ -122,10 +122,11 @@ When a request comes from a different origin, a CORS error message will be displ
122122

123123
The service provides a web page to know its status and make basic configurations. You can access it through <http://127.0.0.1:18625>.
124124

125-
For security reasons, the web setup is disabled by default. You can add the following line to `DSConfiguration.ini` to enable it.
125+
For security reasons, the web setup is disabled by default. You modify the following line in `DSConfiguration.ini` to enable it. If you cannot find the line, you can add it manually.
126126

127-
```
128-
EnableWebSetup=TRUE
127+
```diff
128+
- EnableWebSetup=FALSE
129+
+ EnableWebSetup=TRUE
129130
```
130131

131132
Screenshots:

_articles/extended-usage/pdf-compression.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

_plugins/html_decode_filter.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module Jekyll
2+
module HtmlDecodeFilter
3+
require 'cgi'
4+
5+
def html_decode(input)
6+
return '' if input.nil?
7+
CGI.unescapeHTML(input.to_s)
8+
end
9+
end
10+
end
11+
12+
Liquid::Template.register_filter(Jekyll::HtmlDecodeFilter)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# _plugins/raw_content_for_collections.rb
2+
module Jekyll
3+
class RawContentForCollections < Generator
4+
safe true
5+
priority :low
6+
7+
def generate(site)
8+
site.collections.each do |label, collection|
9+
next unless label == 'articles'
10+
collection.docs.each do |doc|
11+
source_path = File.join(site.source, doc.relative_path)
12+
13+
if File.exist?(source_path)
14+
raw_file_content = File.read(source_path, encoding: 'UTF-8')
15+
content_without_front_matter = remove_front_matter(raw_file_content)
16+
doc.data['raw_content'] = content_without_front_matter
17+
end
18+
end
19+
end
20+
21+
end
22+
23+
private
24+
25+
def remove_front_matter(content)
26+
if content =~ /\A---\s*\n.*?\n---\s*\n+/m
27+
result = content.sub(/\A---\s*\n.*?\n---\s*\n+/m, '')
28+
return result
29+
else
30+
return content
31+
end
32+
end
33+
end
34+
end

_plugins/render_links.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module Jekyll
2+
module CustomFilters
3+
def render_article_links(content)
4+
content = content.gsub(%r{/_articles/(.*?)\.md},
5+
'https://www.dynamsoft.com/web-twain/docs/\1.html')
6+
7+
return content
8+
end
9+
end
10+
end
11+
12+
Liquid::Template.register_filter(Jekyll::CustomFilters)

api.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ sitemap: false
99
{
1010
"title": {{ article.title | jsonify }},
1111
"url": "https://www.dynamsoft.com{{ article.url | relative_url }}",
12-
"content": {{ article.content | strip_html | jsonify }},
12+
"content": {{ article.raw_content | render_article_links | jsonify }},
1313
"breadcrumb": {{ article.breadcrumbText | default: article.title | jsonify }}
1414
}{% unless forloop.last %},{% endunless %}
1515
{% endfor %}
1616
]
17-
}
17+
}

articles.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sitemap: false
88
{
99
"title": {{ article.title | jsonify }},
1010
"url": "https://www.dynamsoft.com{{ article.url | relative_url }}",
11-
"content": {{ article.content | strip_html | jsonify }},
11+
"content": {{ article.raw_content | render_article_links | jsonify }},
1212
"breadcrumb": {{ article.breadcrumbText | default: article.title | jsonify }}
1313
}{% unless forloop.last %},{% endunless %}
1414
{% endfor %}

llms-full.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
layout: null
3+
sitemap: false
4+
---
5+
{% for article in site.articles %}<page>
6+
---
7+
title: {{article.title}}
8+
description: {{article.description}}
9+
source_url:
10+
html: https://www.dynamsoft.com{{ article.url | relative_url }}
11+
md: {{ site.repositoryUrl }}/{{article.path}}
12+
---
13+
{{ article.raw_content }}
14+
</page>
15+
16+
{% endfor %}
17+

llms.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: null
3+
sitemap: false
4+
---
5+
6+
# Dynamic Web TWAIN Docs
7+
8+
## Docs
9+
10+
{% for article in site.articles %}- [{{article.title}}](https://www.dynamsoft.com{{ article.url | relative_url }}): {{ article.description }}
11+
{% endfor %}
12+
13+
## Samples
14+
15+
- [Samples](https://github.com/Dynamsoft/web-twain-codelab/): Samples of Dynamic Web TWAIN

0 commit comments

Comments
 (0)