Skip to content

Commit

Permalink
docs(config): do not ignore commented values
Browse files Browse the repository at this point in the history
  • Loading branch information
chicoxyzzy committed Sep 25, 2023
1 parent dc6dcc0 commit 017ddf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion api/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ flags | | Advanced Compiler Settings (ie C++ compiler -02, -03, etc).
headless | false | If true, the window will never be displayed.
name | | The name of the program and executable to be output. Can't contain spaces or special characters. Required field.
output | "build" | The binary output path. It's recommended to add this path to .gitignore.
script | | The build script

# Section `build.watch`

Expand Down Expand Up @@ -74,7 +75,8 @@ file_limit | | Set the limit of files that can be opened by your process.
lang | | Localization
maintainer | | A String used in the about dialog and meta info.
title | | The title of the app used in metadata files. This is NOT a window title. Can contain spaces and special characters. Defaults to name in a [build] section.
version | "" | Builds an extension when set to "extension". type = "" A string that indicates the version of the application. It should be a semver triple like 1.2.3. Defaults to 1.0.0.
type | "" | Builds an extension when set to "extension".
version | | A string that indicates the version of the application. It should be a semver triple like 1.2.3. Defaults to 1.0.0.

# Section `android`

Expand Down
4 changes: 2 additions & 2 deletions bin/docs-generator/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function parseIni (iniText) {

iniText.split(/\r?\n/).forEach((line) => {
const trimmedLine = line.trim()
if (trimmedLine.startsWith(';')) {
if (trimmedLine.startsWith(';') && !/;\s+\S+\s+=\s+.*/.test(trimmedLine)) {
if (trimmedLine.includes('default value:')) {
defaultValue = trimmedLine.split('default value:')[1].trim()
} else {
Expand All @@ -17,7 +17,7 @@ function parseIni (iniText) {
sections[currentSection] = []
lastComment = ''
} else if (currentSection) {
const keyValue = trimmedLine.split('=')
const keyValue = trimmedLine.replace('; ', '').split('=')
if (keyValue.length === 2) {
sections[currentSection].push({
key: keyValue[0].trim(),
Expand Down

0 comments on commit 017ddf3

Please sign in to comment.