wikinator 0.6.0__tar.gz → 0.6.2__tar.gz
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.
- {wikinator-0.6.0/src/wikinator.egg-info → wikinator-0.6.2}/PKG-INFO +26 -14
- {wikinator-0.6.0 → wikinator-0.6.2}/README.md +19 -5
- {wikinator-0.6.0 → wikinator-0.6.2}/pyproject.toml +15 -1
- wikinator-0.6.2/src/wikinator/.DS_Store +0 -0
- {wikinator-0.6.0 → wikinator-0.6.2}/src/wikinator/__init__.py +12 -2
- {wikinator-0.6.0 → wikinator-0.6.2}/src/wikinator/page.py +10 -10
- {wikinator-0.6.0 → wikinator-0.6.2}/src/wikinator/wiki.py +10 -10
- wikinator-0.6.0/LICENSE +0 -21
- wikinator-0.6.0/PKG-INFO +0 -280
- wikinator-0.6.0/setup.cfg +0 -4
- wikinator-0.6.0/src/wikinator.egg-info/SOURCES.txt +0 -15
- wikinator-0.6.0/src/wikinator.egg-info/dependency_links.txt +0 -1
- wikinator-0.6.0/src/wikinator.egg-info/entry_points.txt +0 -2
- wikinator-0.6.0/src/wikinator.egg-info/requires.txt +0 -8
- wikinator-0.6.0/src/wikinator.egg-info/top_level.txt +0 -1
- {wikinator-0.6.0 → wikinator-0.6.2}/src/wikinator/converter.py +0 -0
- {wikinator-0.6.0 → wikinator-0.6.2}/src/wikinator/docxit.py +0 -0
- {wikinator-0.6.0 → wikinator-0.6.2}/src/wikinator/gdrive.py +0 -0
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: wikinator
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Convert Google docs to markdown
|
|
5
|
-
Project-URL: Documentation, https://github.com/philion/wikinator#readme
|
|
6
|
-
Project-URL: Issues, https://github.com/philion/wikinator/issues
|
|
7
|
-
Project-URL: Source, https://github.com/philion/wikinator
|
|
8
|
-
Requires-Python: >=3.13
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
License-File: LICENSE
|
|
11
5
|
Requires-Dist: dotenv>=0.9.9
|
|
12
6
|
Requires-Dist: google-api-python-client>=2.175.0
|
|
13
7
|
Requires-Dist: google-auth-httplib2>=0.2.0
|
|
@@ -16,7 +10,11 @@ Requires-Dist: gql[all]>=3.5.3
|
|
|
16
10
|
Requires-Dist: pytest>=8.4.1
|
|
17
11
|
Requires-Dist: python-docx>=1.2.0
|
|
18
12
|
Requires-Dist: typer-slim>=0.16.0
|
|
19
|
-
|
|
13
|
+
Requires-Python: >=3.13
|
|
14
|
+
Project-URL: Documentation, https://github.com/philion/wikinator#readme
|
|
15
|
+
Project-URL: Issues, https://github.com/philion/wikinator/issues
|
|
16
|
+
Project-URL: Source, https://github.com/philion/wikinator
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
20
18
|
|
|
21
19
|
# wikinator
|
|
22
20
|
|
|
@@ -39,7 +37,7 @@ Usage: wikinator upload [OPTIONS] SOURCE WIKIROOT
|
|
|
39
37
|
|
|
40
38
|
Arguments:
|
|
41
39
|
SOURCE [required]
|
|
42
|
-
WIKIROOT
|
|
40
|
+
WIKIROOT defaults to root of wiki, /
|
|
43
41
|
|
|
44
42
|
Options:
|
|
45
43
|
--help Show this message and exit.
|
|
@@ -47,7 +45,6 @@ Options:
|
|
|
47
45
|
|
|
48
46
|
Given a directory, convert supported file types into markdown-based files while maintaining names and directory structure. This can then be uploaded into various wiki systems.
|
|
49
47
|
|
|
50
|
-
Here is a simple footnote[^3].
|
|
51
48
|
|
|
52
49
|
### Supported File Types
|
|
53
50
|
- DOCX files (default for GDocs) are converted to markdown
|
|
@@ -64,15 +61,30 @@ The development log will be kept here until the 1.0 release.
|
|
|
64
61
|
|
|
65
62
|
## Usage
|
|
66
63
|
```
|
|
67
|
-
uvx wikinator upload target_dir
|
|
64
|
+
uvx wikinator upload target_dir
|
|
65
|
+
uvx wikinator upload target_file.md new/path
|
|
68
66
|
```
|
|
69
67
|
|
|
70
|
-
`upload` loads a full directory into wiki.
|
|
68
|
+
`upload` loads a full directory into the wiki. In the above examples:
|
|
69
|
+
- Upload the directoy tree at `target_dir` into the wikipath `target_dir`
|
|
70
|
+
- Upload the file `target_file.md` into the wiki path `new/path/target_file`
|
|
71
|
+
|
|
72
|
+
Assuming the `en` locale, the final paths in the wiki will be:
|
|
73
|
+
- $GRAPH_DB/en/target_dir/...
|
|
74
|
+
- $GRAPH_DB/en/new/path/target_file
|
|
71
75
|
|
|
72
76
|
## Install & Configure
|
|
73
77
|
There is nothing to install, the `wikinator` command can be run from anywhere [`uvx` is installed](https://docs.astral.sh/uv/getting-started/installation/).
|
|
74
78
|
|
|
75
|
-
To upload to your wiki, you must have
|
|
79
|
+
To upload to your wiki, you must have the URL and an authorization token.
|
|
80
|
+
|
|
81
|
+
Create a file in your home directory: `~/.config/wikinator.env`
|
|
82
|
+
|
|
83
|
+
In that file, add your wiki GraphQL URL and the access token:
|
|
84
|
+
```
|
|
85
|
+
GRAPH_DB=https://wiki.example.org/graphql
|
|
86
|
+
AUTH_TOKEN=your-authorization-token
|
|
87
|
+
```
|
|
76
88
|
|
|
77
89
|
### wiki.js
|
|
78
90
|
|
|
@@ -19,7 +19,7 @@ Usage: wikinator upload [OPTIONS] SOURCE WIKIROOT
|
|
|
19
19
|
|
|
20
20
|
Arguments:
|
|
21
21
|
SOURCE [required]
|
|
22
|
-
WIKIROOT
|
|
22
|
+
WIKIROOT defaults to root of wiki, /
|
|
23
23
|
|
|
24
24
|
Options:
|
|
25
25
|
--help Show this message and exit.
|
|
@@ -27,7 +27,6 @@ Options:
|
|
|
27
27
|
|
|
28
28
|
Given a directory, convert supported file types into markdown-based files while maintaining names and directory structure. This can then be uploaded into various wiki systems.
|
|
29
29
|
|
|
30
|
-
Here is a simple footnote[^3].
|
|
31
30
|
|
|
32
31
|
### Supported File Types
|
|
33
32
|
- DOCX files (default for GDocs) are converted to markdown
|
|
@@ -44,15 +43,30 @@ The development log will be kept here until the 1.0 release.
|
|
|
44
43
|
|
|
45
44
|
## Usage
|
|
46
45
|
```
|
|
47
|
-
uvx wikinator upload target_dir
|
|
46
|
+
uvx wikinator upload target_dir
|
|
47
|
+
uvx wikinator upload target_file.md new/path
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`upload` loads a full directory into wiki.
|
|
50
|
+
`upload` loads a full directory into the wiki. In the above examples:
|
|
51
|
+
- Upload the directoy tree at `target_dir` into the wikipath `target_dir`
|
|
52
|
+
- Upload the file `target_file.md` into the wiki path `new/path/target_file`
|
|
53
|
+
|
|
54
|
+
Assuming the `en` locale, the final paths in the wiki will be:
|
|
55
|
+
- $GRAPH_DB/en/target_dir/...
|
|
56
|
+
- $GRAPH_DB/en/new/path/target_file
|
|
51
57
|
|
|
52
58
|
## Install & Configure
|
|
53
59
|
There is nothing to install, the `wikinator` command can be run from anywhere [`uvx` is installed](https://docs.astral.sh/uv/getting-started/installation/).
|
|
54
60
|
|
|
55
|
-
To upload to your wiki, you must have
|
|
61
|
+
To upload to your wiki, you must have the URL and an authorization token.
|
|
62
|
+
|
|
63
|
+
Create a file in your home directory: `~/.config/wikinator.env`
|
|
64
|
+
|
|
65
|
+
In that file, add your wiki GraphQL URL and the access token:
|
|
66
|
+
```
|
|
67
|
+
GRAPH_DB=https://wiki.example.org/graphql
|
|
68
|
+
AUTH_TOKEN=your-authorization-token
|
|
69
|
+
```
|
|
56
70
|
|
|
57
71
|
### wiki.js
|
|
58
72
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "wikinator"
|
|
3
|
-
version = "0.6.
|
|
3
|
+
version = "0.6.2"
|
|
4
4
|
description = "Convert Google docs to markdown"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
@@ -35,5 +35,19 @@ tests = ["tests", "*/wikinator/tests"]
|
|
|
35
35
|
[tool.coverage.report]
|
|
36
36
|
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
|
|
37
37
|
|
|
38
|
+
#[tool.hatch]
|
|
39
|
+
|
|
40
|
+
#[build-system]
|
|
41
|
+
#requires = ["hatchling"]
|
|
42
|
+
#build-backend = "hatchling.build"
|
|
43
|
+
|
|
44
|
+
#[tool.hatch.build.targets.wheel]
|
|
45
|
+
#packages = ["src/wikinator"]
|
|
46
|
+
|
|
47
|
+
[build-system]
|
|
48
|
+
requires = ["uv_build>=0.8.10,<0.9.0"]
|
|
49
|
+
build-backend = "uv_build"
|
|
50
|
+
|
|
51
|
+
|
|
38
52
|
[project.scripts]
|
|
39
53
|
wikinator = "wikinator:app"
|
|
Binary file
|
|
@@ -4,6 +4,9 @@ import json
|
|
|
4
4
|
import typer
|
|
5
5
|
from typing import Optional
|
|
6
6
|
from typing_extensions import Annotated
|
|
7
|
+
import os
|
|
8
|
+
from dotenv import load_dotenv
|
|
9
|
+
|
|
7
10
|
|
|
8
11
|
from .wiki import GraphIngester, GraphDB
|
|
9
12
|
|
|
@@ -73,7 +76,9 @@ def trace_callback(value: bool) -> None:
|
|
|
73
76
|
@app.command()
|
|
74
77
|
def upload(
|
|
75
78
|
source: str,
|
|
76
|
-
wikiroot: str,
|
|
79
|
+
wikiroot: str = "/",
|
|
80
|
+
#url: Annotated[str, typer.Option("--db", help="URL of the GraphQL database")] = os.getenv("GRAPH_DB"),
|
|
81
|
+
#token: Annotated[str, typer.Option("--token", help="URL of the GraphQL database")] = os.getenv("AUTH_TOKEN"),
|
|
77
82
|
output: Annotated[bool, typer.Option("-o", help="Make a local copy of the converted file")] = False,
|
|
78
83
|
) -> None:
|
|
79
84
|
"""
|
|
@@ -86,7 +91,12 @@ def upload(
|
|
|
86
91
|
For example, with source=/src and wikiroot=/wiki/root,
|
|
87
92
|
a DOCX file at /src/dir/some_file.docx will be uploaded to /wiki/root/dir/some_file on the wiki.
|
|
88
93
|
"""
|
|
89
|
-
|
|
94
|
+
load_dotenv(dotenv_path=os.path.expanduser("~/.config/wikinator.env"))
|
|
95
|
+
url = os.getenv("GRAPH_DB")
|
|
96
|
+
token = os.getenv("AUTH_TOKEN")
|
|
97
|
+
log.debug(f"Loaded env, db={url}")
|
|
98
|
+
|
|
99
|
+
GraphIngester(url=url, token=token, output=output).convert_directory(source, wikiroot)
|
|
90
100
|
|
|
91
101
|
|
|
92
102
|
# Setup global options using callbacks
|
|
@@ -39,16 +39,16 @@ class Page:
|
|
|
39
39
|
@classmethod
|
|
40
40
|
def load(cls, params: dict[str,any]):
|
|
41
41
|
return cls(
|
|
42
|
-
id = params
|
|
43
|
-
content = params
|
|
44
|
-
editor = params
|
|
45
|
-
isPublished = params
|
|
46
|
-
isPrivate = params
|
|
47
|
-
locale = params
|
|
48
|
-
path = params
|
|
49
|
-
tags = params
|
|
50
|
-
title = params
|
|
51
|
-
description = params
|
|
42
|
+
id = params.get("id"),
|
|
43
|
+
content = params.get("content"),
|
|
44
|
+
editor = params.get("editor"),
|
|
45
|
+
isPublished = params.get("isPublished"),
|
|
46
|
+
isPrivate = params.get("isPrivate"),
|
|
47
|
+
locale = params.get("locale"),
|
|
48
|
+
path = params.get("path"),
|
|
49
|
+
tags = params.get("tags"),
|
|
50
|
+
title = params.get("title"),
|
|
51
|
+
description = params.get("description"),
|
|
52
52
|
)
|
|
53
53
|
|
|
54
54
|
|
|
@@ -17,20 +17,17 @@ log = logging.getLogger(__name__)
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class GraphDB:
|
|
20
|
-
def __init__(self):
|
|
21
|
-
self.client = self._init_client()
|
|
20
|
+
def __init__(self, url:str, token:str):
|
|
21
|
+
self.client = self._init_client(url, token)
|
|
22
22
|
self.pageCache = self.all_pages()
|
|
23
23
|
|
|
24
|
-
def _init_client(self) -> Client:
|
|
24
|
+
def _init_client(self, url:str, token:str) -> Client:
|
|
25
25
|
"""
|
|
26
26
|
Initialize the GraphQL client with the credentials found in the system ENV:
|
|
27
27
|
- GRAPH_DB : The full URL for requests to the graph DB
|
|
28
28
|
- AUTH_TOKEN : Security token to authorize session
|
|
29
29
|
"""
|
|
30
|
-
|
|
31
|
-
db_url = os.getenv("GRAPH_DB")
|
|
32
|
-
token = os.getenv("AUTH_TOKEN")
|
|
33
|
-
transport = AIOHTTPTransport(url=db_url, headers={'Authorization': f'Bearer {token}'}, ssl=True)
|
|
30
|
+
transport = AIOHTTPTransport(url=url, headers={'Authorization': f'Bearer {token}'}, ssl=True)
|
|
34
31
|
return Client(transport=transport)
|
|
35
32
|
|
|
36
33
|
|
|
@@ -218,13 +215,16 @@ class GraphDB:
|
|
|
218
215
|
|
|
219
216
|
|
|
220
217
|
class GraphIngester(Converter):
|
|
221
|
-
def __init__(self, output:bool = False):
|
|
222
|
-
self.db = GraphDB()
|
|
218
|
+
def __init__(self, url:str, token:str, output:bool = False):
|
|
219
|
+
self.db = GraphDB(url, token)
|
|
223
220
|
self.output = output
|
|
224
221
|
|
|
225
222
|
# use the "file walk" from the converter to upload
|
|
226
223
|
def convert_file(self, full_path:Path, outroot:str):
|
|
227
|
-
|
|
224
|
+
if outroot.strip() in ["/", ""]:
|
|
225
|
+
wikipath = f"{full_path.parent}/{full_path.stem}"
|
|
226
|
+
else:
|
|
227
|
+
wikipath = f"{outroot}/{full_path.parent}/{full_path.stem}"
|
|
228
228
|
log.info(f"Converting {full_path} into {wikipath}")
|
|
229
229
|
|
|
230
230
|
page = DocxitConverter.load_file(full_path)
|
wikinator-0.6.0/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Paul Philion
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
wikinator-0.6.0/PKG-INFO
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: wikinator
|
|
3
|
-
Version: 0.6.0
|
|
4
|
-
Summary: Convert Google docs to markdown
|
|
5
|
-
Project-URL: Documentation, https://github.com/philion/wikinator#readme
|
|
6
|
-
Project-URL: Issues, https://github.com/philion/wikinator/issues
|
|
7
|
-
Project-URL: Source, https://github.com/philion/wikinator
|
|
8
|
-
Requires-Python: >=3.13
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Requires-Dist: dotenv>=0.9.9
|
|
12
|
-
Requires-Dist: google-api-python-client>=2.175.0
|
|
13
|
-
Requires-Dist: google-auth-httplib2>=0.2.0
|
|
14
|
-
Requires-Dist: google-auth-oauthlib>=1.2.2
|
|
15
|
-
Requires-Dist: gql[all]>=3.5.3
|
|
16
|
-
Requires-Dist: pytest>=8.4.1
|
|
17
|
-
Requires-Dist: python-docx>=1.2.0
|
|
18
|
-
Requires-Dist: typer-slim>=0.16.0
|
|
19
|
-
Dynamic: license-file
|
|
20
|
-
|
|
21
|
-
# wikinator
|
|
22
|
-
|
|
23
|
-
Convert a Google drive download into a markdown-based wiki.
|
|
24
|
-
|
|
25
|
-
**Note**: This is a work in progress, and not all features will be supported or working properly.
|
|
26
|
-
|
|
27
|
-
## tl;dr
|
|
28
|
-
```
|
|
29
|
-
uvx wikinator upload --help
|
|
30
|
-
Usage: wikinator upload [OPTIONS] SOURCE WIKIROOT
|
|
31
|
-
|
|
32
|
-
Convert and upload a file hierarchy to a GraphQL wiki. Given a source
|
|
33
|
-
directrory, walk the directory tree and for each file: - if MD or image
|
|
34
|
-
file, upload at the same path relative to the wikiroot path - If DOCX,
|
|
35
|
-
convert to MD and upload at the same path... - Unknown files are skipped.
|
|
36
|
-
For example, with source=/src and wikiroot=/wiki/root, A DOCX file at
|
|
37
|
-
/src/dir/some_file.docx will be uploaded to /wiki/root/dir/some_file on the
|
|
38
|
-
wiki.
|
|
39
|
-
|
|
40
|
-
Arguments:
|
|
41
|
-
SOURCE [required]
|
|
42
|
-
WIKIROOT [required]
|
|
43
|
-
|
|
44
|
-
Options:
|
|
45
|
-
--help Show this message and exit.
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Given a directory, convert supported file types into markdown-based files while maintaining names and directory structure. This can then be uploaded into various wiki systems.
|
|
49
|
-
|
|
50
|
-
Here is a simple footnote[^3].
|
|
51
|
-
|
|
52
|
-
### Supported File Types
|
|
53
|
-
- DOCX files (default for GDocs) are converted to markdown
|
|
54
|
-
- images are extracted, uploaded and embedded in the markdown
|
|
55
|
-
- FUTURE `text` and code file types are wrapped in markdown code blocks
|
|
56
|
-
- FUTURE CSV and XSLT are converted to markdown tables
|
|
57
|
-
- FUTURE for any document that is converted to markdown, a copy of the original is uploaded and attached
|
|
58
|
-
|
|
59
|
-
### Supported Wiki Import
|
|
60
|
-
- wiki.js (and other GraphQL-based wikis)
|
|
61
|
-
- Obsidian
|
|
62
|
-
|
|
63
|
-
The development log will be kept here until the 1.0 release.
|
|
64
|
-
|
|
65
|
-
## Usage
|
|
66
|
-
```
|
|
67
|
-
uvx wikinator upload target_dir wikipath
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
`upload` loads a full directory into wiki.js
|
|
71
|
-
|
|
72
|
-
## Install & Configure
|
|
73
|
-
There is nothing to install, the `wikinator` command can be run from anywhere [`uvx` is installed](https://docs.astral.sh/uv/getting-started/installation/).
|
|
74
|
-
|
|
75
|
-
To upload to your wiki, you must have credentials.
|
|
76
|
-
|
|
77
|
-
### wiki.js
|
|
78
|
-
|
|
79
|
-
TODO: Details on setting up creds for wikijs.
|
|
80
|
-
|
|
81
|
-
Once you have the URL and authorization token from wiki,js, add them to an `.env` file:
|
|
82
|
-
```
|
|
83
|
-
GRAPH_DB=https://wiki.example.com/graphql
|
|
84
|
-
AUTH_TOKEN=kfhgdkfjhgkdjfhgkdjhfgk...
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Once this file is set up correctly, `wikinator` is run with:
|
|
88
|
-
```
|
|
89
|
-
uvx wikinator upload --help
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
## Build & Test
|
|
94
|
-
1. Clone
|
|
95
|
-
```
|
|
96
|
-
git clone https://github.com/philion/wikinator.git
|
|
97
|
-
cd wikinator
|
|
98
|
-
```
|
|
99
|
-
2. Run, with uv
|
|
100
|
-
```
|
|
101
|
-
uv run wikinator [options]
|
|
102
|
-
```
|
|
103
|
-
3. Test, with pytest
|
|
104
|
-
```
|
|
105
|
-
uv run pytest
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Development Log
|
|
109
|
-
|
|
110
|
-
### 2025-08-07
|
|
111
|
-
Refactored and disabled (for now) the convert, extract and teleport commands. The code remains in place, but the
|
|
112
|
-
current focus is on convert and upload to graphql, and I wan to disable any code that's not in that path while testing.
|
|
113
|
-
|
|
114
|
-
Added a verbose logging option, `-v`, to watch files being processed.
|
|
115
|
-
|
|
116
|
-
### 2025-07-08
|
|
117
|
-
Initial (buggy, probably) implementation of the full command set:
|
|
118
|
-
- `convert` converts directory full of DOCX into markdown.
|
|
119
|
-
- `extract` extracts the docs from google docs as markdown.
|
|
120
|
-
- `upload` loads a full directory into wiki.js
|
|
121
|
-
- `teleport` goes directly from google drive to wiki.js.
|
|
122
|
-
|
|
123
|
-
### 2025-07-07
|
|
124
|
-
Decent progress with google drive download. Still lots of problems.
|
|
125
|
-
- [ ] get single file and dir params working.
|
|
126
|
-
- [x] fix `\n` translation problem. where are they coming from
|
|
127
|
-
- [ ] for single input file, assume single output filename (if doen't exists). if does, and is dir, write -in-.
|
|
128
|
-
- [x] simple formatting tests
|
|
129
|
-
- [ ] research which converter google is using
|
|
130
|
-
|
|
131
|
-
pandoc doesn't do embedding the same way (HTML-only): https://pandoc.org/MANUAL.html#option--embed-resources%5B
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
### 2025-07-06
|
|
135
|
-
Getting into formatting details, and I want to decompse and stream-line the docxit converter.
|
|
136
|
-
- [x] docxit creates in memory
|
|
137
|
-
- [x] better page handling, read and write files to disk
|
|
138
|
-
- [x] get first test working
|
|
139
|
-
- [x] simple formatting tests
|
|
140
|
-
- [x] build commands (unimplemented)
|
|
141
|
-
- [ ] for single input file, assume single output filename (if doen't exists). if does, and is dir, write -in-.
|
|
142
|
-
|
|
143
|
-
Let's combine testing lists with a simple test:
|
|
144
|
-
- load a file with a list
|
|
145
|
-
- convert
|
|
146
|
-
- confirm it contains the correct list
|
|
147
|
-
|
|
148
|
-
Moved the code around to simplify and remove potential circular dependencies.
|
|
149
|
-
|
|
150
|
-
Code runs as expected, as does trival test case.
|
|
151
|
-
|
|
152
|
-
Bumping version to 0.5, but not yet ready to release.
|
|
153
|
-
|
|
154
|
-
Thinking about commands:
|
|
155
|
-
- convert : files -> files
|
|
156
|
-
- extract : from googledocs -> file system
|
|
157
|
-
- upload : from files -> graphql
|
|
158
|
-
- teleport : from googledoc -> graphql
|
|
159
|
-
|
|
160
|
-
Refactored __main__ to better commands. Got `-v` working.
|
|
161
|
-
|
|
162
|
-
Original behavior is working as `wikinator convert`.
|
|
163
|
-
|
|
164
|
-
Now looking at extract command.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
### 2025-07-05
|
|
168
|
-
Starting work on image preservation.
|
|
169
|
-
|
|
170
|
-
Looking first at https://github.com/haesleinhuepf/docx2markdown for images.
|
|
171
|
-
|
|
172
|
-
Created a `Docx2MarkdownConverter` which almost works: images are put in the wrong path in the MD (`s/images/` instead of just `images`).
|
|
173
|
-
There's probably an easy fix, but lets try a pandoc version.
|
|
174
|
-
|
|
175
|
-
Creating `PandocConverter` to try and compare output.
|
|
176
|
-
```
|
|
177
|
-
pandoc {indoc} -f docx -t markdown --wrap=none --markdown-headings=atx --extract-media=images -o {outdoc}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
Neither produces desired results.
|
|
181
|
-
|
|
182
|
-
Trying a literal hack of docx2markdown, to see how quickly I can fix the little problems I saw.
|
|
183
|
-
|
|
184
|
-
Got it working quickly, removed a little bug, got the images.
|
|
185
|
-
|
|
186
|
-
Now looking over the DOCX XML format to see how much I can scrape out.
|
|
187
|
-
|
|
188
|
-
https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.fontsizecomplexscript?view=openxml-3.0.1
|
|
189
|
-
|
|
190
|
-
Added detection for strikethru and Courier New (as "code font").
|
|
191
|
-
|
|
192
|
-
This is good enough for v0.2!
|
|
193
|
-
|
|
194
|
-
Oops. minor bug. fixing with v0.3
|
|
195
|
-
|
|
196
|
-
Noticed when working on strikethru that nested lists didn't seem to be working.
|
|
197
|
-
|
|
198
|
-
Next tasks:
|
|
199
|
-
- [x] List handling
|
|
200
|
-
- [x] Code cleanup (remove unused libs)
|
|
201
|
-
- [ ] restructure docxit for in-memory
|
|
202
|
-
- [ ] simple testing.
|
|
203
|
-
- [x] recognize and handle single file
|
|
204
|
-
- [x] default output to local dir
|
|
205
|
-
|
|
206
|
-
Looking over the raw XML, it looks like...
|
|
207
|
-
```xml
|
|
208
|
-
<w:numPr>
|
|
209
|
-
<w:ilvl w:val="0" />
|
|
210
|
-
<w:numId w:val="2" />
|
|
211
|
-
</w:numPr>
|
|
212
|
-
```
|
|
213
|
-
It looks like:
|
|
214
|
-
* `w:ilvl` is the zero-based indent level
|
|
215
|
-
* `w:numId` is an ID from numbering.xml, roughly mapping to:
|
|
216
|
-
- val=1 ordered list: `1. `
|
|
217
|
-
- val=2 checklist: `- [ ]`
|
|
218
|
-
- val=3 bullet: `* `
|
|
219
|
-
|
|
220
|
-
Restructured and cleaned up. Removed unneeded code and libraried.
|
|
221
|
-
|
|
222
|
-
Created a simple docx doc for testing.
|
|
223
|
-
|
|
224
|
-
Far enough that a new release feels right. v0.4!
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
### 2025-07-04
|
|
228
|
-
Let's make a project! Today's goals:
|
|
229
|
-
- [x] clean up code and README
|
|
230
|
-
- [x] add CLI options, using type (not all implemented)
|
|
231
|
-
- [x] initial commit to github
|
|
232
|
-
- [ ] add image handling
|
|
233
|
-
- [x] upload to pypi and confirm uvx commands
|
|
234
|
-
|
|
235
|
-
Cruft removed. README updated. (author waves, breaking 4th wall)
|
|
236
|
-
|
|
237
|
-
Moving on the main() cleanup and adding support for https://github.com/fastapi/typer
|
|
238
|
-
|
|
239
|
-
Added simple CLI options for src and dest. Got end-to-end tree processing.
|
|
240
|
-
|
|
241
|
-
Added Makefile to help with release management. Got PyPI setup: https://pypi.org/project/wikinator/
|
|
242
|
-
|
|
243
|
-
`uvx wikinator` is working.
|
|
244
|
-
|
|
245
|
-
Let's go for git and call it a day!
|
|
246
|
-
|
|
247
|
-
### 2025-07-03
|
|
248
|
-
Next steps are testing different document converters and accessing google drive via API.
|
|
249
|
-
|
|
250
|
-
#### Markdown conversion libraries
|
|
251
|
-
- pandoc, see https://docs.asciidoctor.org/asciidoctor/latest/migrate/ms-word/
|
|
252
|
-
- markitdown, https://github.com/microsoft/markitdown
|
|
253
|
-
- docx2markdown, https://github.com/haesleinhuepf/docx2markdown
|
|
254
|
-
- docx2md, https://github.com/mattn/docx2md
|
|
255
|
-
|
|
256
|
-
Reference:
|
|
257
|
-
- https://www.docstomarkdown.pro/convert-word-or-docs-to-markdown-using-pandoc/
|
|
258
|
-
|
|
259
|
-
#### Google Drive API
|
|
260
|
-
Starting with https://developers.google.com/workspace/drive/api/quickstart/python
|
|
261
|
-
|
|
262
|
-
> Note: Follow those Google directions for setting up everything. It's complicated compared to simply generating a service token. Your intrepid author made different tokens in different accounts and couldn't access anything! And get permissions right! Document specific needs in intstall docs.
|
|
263
|
-
|
|
264
|
-
Further aside: There are two versions of the tool: file-based and google-takeout. The google related stuff will always be a bear to setup.
|
|
265
|
-
|
|
266
|
-
Made suffienct progress to feel like there a seperate CLI tool here. Set aside for now, and focus on:
|
|
267
|
-
1. Build file-based output
|
|
268
|
-
2. Generate and link images
|
|
269
|
-
3. Clean up for initial 0.1 version
|
|
270
|
-
|
|
271
|
-
### 2025-07-02
|
|
272
|
-
Initial time-boxed work started to examine what would be required to migrate our existing GoogleDocs-based info repo into a wiki, with wiki.js being targeted.
|
|
273
|
-
|
|
274
|
-
Initial proof-of-concept goals:
|
|
275
|
-
- Convert a docx page to md or asciidoc
|
|
276
|
-
- Upload test pages to wiki.js
|
|
277
|
-
|
|
278
|
-
[^3]: At 25-08-10 19:35, Paul Philion said: This is a test comment.
|
|
279
|
-
|
|
280
|
-
I was able to get this working in sample code in a few hours.
|
wikinator-0.6.0/setup.cfg
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
README.md
|
|
3
|
-
pyproject.toml
|
|
4
|
-
src/wikinator/__init__.py
|
|
5
|
-
src/wikinator/converter.py
|
|
6
|
-
src/wikinator/docxit.py
|
|
7
|
-
src/wikinator/gdrive.py
|
|
8
|
-
src/wikinator/page.py
|
|
9
|
-
src/wikinator/wiki.py
|
|
10
|
-
src/wikinator.egg-info/PKG-INFO
|
|
11
|
-
src/wikinator.egg-info/SOURCES.txt
|
|
12
|
-
src/wikinator.egg-info/dependency_links.txt
|
|
13
|
-
src/wikinator.egg-info/entry_points.txt
|
|
14
|
-
src/wikinator.egg-info/requires.txt
|
|
15
|
-
src/wikinator.egg-info/top_level.txt
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
wikinator
|
|
File without changes
|
|
File without changes
|
|
File without changes
|