@brillout/docpress 0.6.21-commit-c920754 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,7 +51,13 @@ function NavItemComponent(_a) {
51
51
  }
52
52
  else {
53
53
  var sectionTitle = jsxToTextContent(titleJsx);
54
- assertWarning(navItem.url, "".concat(jsxToTextContent(titleInNavJsx), " is missing a URL hash. Use `<h2 id=\"url-hash\">").concat(sectionTitle, "</h2>` instead of `## ").concat(sectionTitle, "`."));
54
+ assertWarning(navItem.url, [
55
+ "".concat(jsxToTextContent(titleInNavJsx), " is missing a URL hash."),
56
+ "Add a URL hash with: `## ".concat(sectionTitle, "{#some-hash}`."),
57
+ /* TODO/eventually: not implemented yet.
58
+ `Use \`<h2 id="url-hash">${sectionTitle}</h2>\` instead of \`## ${sectionTitle}\`.`,
59
+ */
60
+ ].join(' '));
55
61
  }
56
62
  return (React.createElement("a", { className: [
57
63
  'nav-item',
@@ -73,7 +73,11 @@ function transform(code) {
73
73
  if (isCodeBlock) {
74
74
  return line;
75
75
  }
76
- if (line.startsWith('#')) {
76
+ if (line.startsWith('#')
77
+ /* TODO/eventually: implement.
78
+ || line.startsWith('<h2')
79
+ */
80
+ ) {
77
81
  var _a = parsePageSection(line), pageSectionId = _a.pageSectionId, pageSectionLevel = _a.pageSectionLevel, pageSectionTitle = _a.pageSectionTitle, headingHtml = _a.headingHtml;
78
82
  pageSections.push({ pageSectionId: pageSectionId, pageSectionLevel: pageSectionLevel, pageSectionTitle: pageSectionTitle });
79
83
  return headingHtml;
@@ -101,9 +101,13 @@ function NavItemComponent({
101
101
  const sectionTitle = jsxToTextContent(titleJsx)
102
102
  assertWarning(
103
103
  navItem.url,
104
- `${jsxToTextContent(
105
- titleInNavJsx,
106
- )} is missing a URL hash. Use \`<h2 id="url-hash">${sectionTitle}</h2>\` instead of \`## ${sectionTitle}\`.`,
104
+ [
105
+ `${jsxToTextContent(titleInNavJsx)} is missing a URL hash.`,
106
+ `Add a URL hash with: \`## ${sectionTitle}{#some-hash}\`.`,
107
+ /* TODO/eventually: not implemented yet.
108
+ `Use \`<h2 id="url-hash">${sectionTitle}</h2>\` instead of \`## ${sectionTitle}\`.`,
109
+ */
110
+ ].join(' '),
107
111
  )
108
112
  }
109
113
  return (
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.6.21-commit-c920754",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
- "// Build vite.config.ts and +config.ts": "",
6
+ "======== Build": "",
7
+ "// Build vite.config.ts and +config.ts (other files don't need to be built as @brillout/docpress is noExternal)": "",
7
8
  "build": "rm -rf dist/ && tsc --project tsconfig.config.json",
8
- "// Development": "",
9
+ "======== Develop": "",
9
10
  "dev": "tsc --watch --project tsconfig.config.json",
10
- "// Check types while developing": "",
11
+ "// Check types of all source files while developing": "",
11
12
  "typecheck": "tsc --noEmit --watch",
12
- "// Release": "",
13
+ "========= Release": "",
13
14
  "release": "release-me patch",
14
- "release:commit": "release-me commit",
15
- "release:breaking-change": "release-me minor"
15
+ "release:minor": "release-me minor",
16
+ "release:commit": "release-me commit"
16
17
  },
17
18
  "dependencies": {
18
19
  "@brillout/picocolors": "^1.0.10",
@@ -44,7 +44,12 @@ function transform(code: string) {
44
44
  return line
45
45
  }
46
46
 
47
- if (line.startsWith('#')) {
47
+ if (
48
+ line.startsWith('#')
49
+ /* TODO/eventually: implement.
50
+ || line.startsWith('<h2')
51
+ */
52
+ ) {
48
53
  const { pageSectionId, pageSectionLevel, pageSectionTitle, headingHtml } = parsePageSection(line)
49
54
  pageSections.push({ pageSectionId, pageSectionLevel, pageSectionTitle })
50
55
  return headingHtml
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
- "include": ["vite.config.ts", "+config.ts"],
3
+ "files": ["vite.config.ts", "+config.ts"],
4
4
  "compilerOptions": {
5
5
  "outDir": "./dist/"
6
6
  }