Skip to content

Commit db08ab7

Browse files
committed
Yet another change to table cell docs.
1 parent e174eb4 commit db08ab7

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

docs/api.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,9 +996,7 @@ file should be opened. It can be a combination of the following flags:
996996
| `FS_TRUNCATE` | Only valid when used with `FS_WRITE`. If the file already exists, it will be truncated to zero length when opened. If the file does not exist, it will be created. Not compatible with `FS_APPEND`. |
997997
| `FS_APPEND` | Only valid when used with `FS_WRITE`. All writes will occur at the end of the file, regardless of the current cursor position. If the file does not exist, it will be created. Not compatible with `FS_TRUNCATE`. |
998998
| `FS_EXCLUSIVE` | Only valid when used with `FS_WRITE`. The file will be created, but if it already exists, the open will fail with FS_ALREADY_EXISTS. |
999-
| `FS_TRANSPARENT` | This is the default behavior. When used, files inside archives can be opened transparently. For example, "somefolder/archive.zip/file.txt" can be opened with "somefolder/file.txt" (the "archive.zip" part need not be specified). This assumes the `fs` object has been initialized with support for the relevant archive types.<br><br>Transparent mode is the slowest mode since it requires searching through the file system for archives, and then open those archives, and then searching through the archive for the file. If this is prohibitive, consider using `FS_OPAQUE` (fastest) or `FS_VERBOSE` modes instead.<br><br>Furthermore, you can consider having a rule in your application that instead of opening files inside archives from a transparent path, that you instead mount the archive, and then open all files with `FS_OPAQUE`, but with a virtual path that points to the archive. For example: <pre><code>
1000-
fs_mount(pFS, "somefolder/archive.zip", "assets", FS_READ);
1001-
fs_file_open(pFS, "assets/file.txt", FS_READ \| FS_OPAQUE, &pFile);</code></pre><br>Here the archive is mounted to the virtual path "assets". Because the path "assets/file.txt" is prefixed with "assets", the file system knows to look inside the mounted archive without having to search for it. |
999+
| `FS_TRANSPARENT` | This is the default behavior. When used, files inside archives can be opened transparently. For example, "somefolder/archive.zip/file.txt" can be opened with "somefolder/file.txt" (the "archive.zip" part need not be specified). This assumes the `fs` object has been initialized with support for the relevant archive types.<br><br>Transparent mode is the slowest mode since it requires searching through the file system for archives, and then open those archives, and then searching through the archive for the file. If this is prohibitive, consider using `FS_OPAQUE` (fastest) or `FS_VERBOSE` modes instead.<br><br>Furthermore, you can consider having a rule in your application that instead of opening files inside archives from a transparent path, that you instead mount the archive, and then open all files with `FS_OPAQUE`, but with a virtual path that points to the archive. For example: <br> <br> fs_mount(pFS, "somefolder/archive.zip", "assets", FS_READ);<br> fs_file_open(pFS, "assets/file.txt", FS_READ \| FS_OPAQUE, &pFile);<br><br>Here the archive is mounted to the virtual path "assets". Because the path "assets/file.txt" is prefixed with "assets", the file system knows to look inside the mounted archive without having to search for it. |
10021000
| `FS_OPAQUE` | When used, archives will be treated as opaque, meaning attempting to open a file from an unmounted archive will fail. For example, "somefolder/archive.zip/file.txt" will fail because it is inside an archive. This is the fastest mode, but you will not be able to open files from inside archives unless it is sourced from a mount. |
10031001
| `FS_VERBOSE` | When used, files inside archives can be opened, but the name of the archive must be specified explicitly in the path, such as "somefolder/archive.zip/file.txt". This is faster than `FS_TRANSPARENT` mode since it does not require searching for archives. |
10041002
| `FS_NO_CREATE_DIRS` | When opening a file in write mode, the default behavior is to create the directory structure automatically if required. When this options is used, directories will *not* be created automatically. If the necessary parent directories do not exist, the open will fail with FS_DOES_NOT_EXIST. |

tools/fsdoc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,12 +2004,12 @@ static char* fsdoc_convert_options_to_table(const char* pStr, const fs_allocatio
20042004
pWrite++;
20052005
}
20062006
}
2007-
strcpy(pWrite, "<pre><code>");
2008-
pWrite += 11;
2007+
strcpy(pWrite, "<br> ");
2008+
pWrite += 8;
20092009
in_code_block = 1;
20102010
} else if (!is_code_line && in_code_block) {
2011-
strcpy(pWrite, "</code></pre>");
2012-
pWrite += 13;
2011+
strcpy(pWrite, "<br>");
2012+
pWrite += 4;
20132013
in_code_block = 0;
20142014
just_closed_code_block = 1;
20152015
}
@@ -2038,8 +2038,8 @@ static char* fsdoc_convert_options_to_table(const char* pStr, const fs_allocatio
20382038
}
20392039
}
20402040
} else if (is_code_line && in_code_block && !first_desc_line) {
2041-
strcpy(pWrite, "\n");
2042-
pWrite++;
2041+
strcpy(pWrite, "<br> ");
2042+
pWrite += 8;
20432043
}
20442044

20452045
/* Trim leading spaces from code lines */
@@ -2069,8 +2069,8 @@ static char* fsdoc_convert_options_to_table(const char* pStr, const fs_allocatio
20692069

20702070
/* Close any open code block */
20712071
if (in_code_block) {
2072-
strcpy(pWrite, "</code></pre>");
2073-
pWrite += 13;
2072+
strcpy(pWrite, "<br>");
2073+
pWrite += 4;
20742074
}
20752075

20762076
/* End the table row */

0 commit comments

Comments
 (0)