journal-manager 1.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.
- journal_manager-1.2/LICENSE.txt +9 -0
- journal_manager-1.2/MANIFEST.in +1 -0
- journal_manager-1.2/PKG-INFO +110 -0
- journal_manager-1.2/README.md +74 -0
- journal_manager-1.2/pyproject.toml +103 -0
- journal_manager-1.2/setup.cfg +4 -0
- journal_manager-1.2/src/danoan/journal_manager/__init__.py +8 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/file-monitor/file-monitor-action.tpl.sh +46 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/file-monitor/file-monitor.tpl.sh +28 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/http-server/init.js +24 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/http-server/package.json +5 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/assets/images/arrow-down.svg +14 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/assets/images/favicon.png +0 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/assets/javascripts/bundle.078830c0.min.js +29 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/assets/javascripts/bundle.078830c0.min.js.map +8 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/assets/stylesheets/main.20d9efc8.min.css +1 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/assets/stylesheets/main.20d9efc8.min.css.map +1 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/assets/stylesheets/palette.cbb835fc.min.css +1 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/assets/stylesheets/palette.cbb835fc.min.css.map +1 -0
- journal_manager-1.2/src/danoan/journal_manager/assets/templates/material-index/index.tpl.html +250 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/__init__.py +0 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/cli.py +41 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/__init__.py +0 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/build.py +734 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal.py +110 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal_commands/__init__.py +7 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal_commands/activate.py +85 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal_commands/create.py +202 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal_commands/deactivate.py +80 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal_commands/deregister.py +86 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal_commands/edit.py +126 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal_commands/register.py +88 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/journal_commands/show.py +97 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/setup.py +99 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/setup_commands/__init__.py +1 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/setup_commands/init.py +163 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/template.py +81 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/template_commands/__init__.py +0 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/template_commands/register.py +111 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/template_commands/remove.py +82 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/commands/template_commands/show.py +95 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/utils.py +95 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/wrappers/__init__.py +0 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/wrappers/general_proc_call.py +9 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/wrappers/mkdocs_wrapper.py +24 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/wrappers/node_wrapper.py +22 -0
- journal_manager-1.2/src/danoan/journal_manager/cli/wrappers/nvim_wrapper.py +17 -0
- journal_manager-1.2/src/danoan/journal_manager/core/__init__.py +0 -0
- journal_manager-1.2/src/danoan/journal_manager/core/api.py +249 -0
- journal_manager-1.2/src/danoan/journal_manager/core/exceptions.py +49 -0
- journal_manager-1.2/src/danoan/journal_manager/core/model.py +80 -0
- journal_manager-1.2/src/journal_manager.egg-info/PKG-INFO +110 -0
- journal_manager-1.2/src/journal_manager.egg-info/SOURCES.txt +62 -0
- journal_manager-1.2/src/journal_manager.egg-info/dependency_links.txt +1 -0
- journal_manager-1.2/src/journal_manager.egg-info/entry_points.txt +2 -0
- journal_manager-1.2/src/journal_manager.egg-info/requires.txt +9 -0
- journal_manager-1.2/src/journal_manager.egg-info/top_level.txt +1 -0
- journal_manager-1.2/test/test_api.py +69 -0
- journal_manager-1.2/test/test_build.py +198 -0
- journal_manager-1.2/test/test_journal.py +176 -0
- journal_manager-1.2/test/test_parsers.py +106 -0
- journal_manager-1.2/test/test_setup.py +101 -0
- journal_manager-1.2/test/test_template.py +55 -0
- journal_manager-1.2/test/test_utils.py +5 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-present Daniel Martins Antunes <danoan2008@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
graft src/danoan/journal_manager/assets/templates
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: journal-manager
|
|
3
|
+
Version: 1.2
|
|
4
|
+
Author-email: Daniel Martins Antunes <danoan2008@gmail.com>
|
|
5
|
+
License: MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2022-present Daniel Martins Antunes <danoan2008@gmail.com>
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
14
|
+
|
|
15
|
+
Project-URL: Documentation, https://github.com/danoan/journal-manager#readme
|
|
16
|
+
Project-URL: Issues, https://github.com/danoan/journal-manager/issues
|
|
17
|
+
Project-URL: Source, https://github.com/danoan/journal-manager
|
|
18
|
+
Classifier: Development Status :: 4 - Beta
|
|
19
|
+
Classifier: Programming Language :: Python
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
22
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE.txt
|
|
26
|
+
Requires-Dist: dataclasses
|
|
27
|
+
Requires-Dist: jinja2
|
|
28
|
+
Requires-Dist: toml
|
|
29
|
+
Requires-Dist: typing_extensions
|
|
30
|
+
Requires-Dist: mkdocs
|
|
31
|
+
Requires-Dist: mkdocs-material
|
|
32
|
+
Requires-Dist: importlib_resources
|
|
33
|
+
Requires-Dist: quick-notes
|
|
34
|
+
Requires-Dist: toml_dataclass
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# Getting started with journal-manager
|
|
38
|
+
|
|
39
|
+
Organize your MkDocs journals with ease, fostering focused learning one topic at a time.
|
|
40
|
+
[Read the docs](https://danoan.github.io/journal-manager/).
|
|
41
|
+
|
|
42
|
+
## What is journal-manager?
|
|
43
|
+
|
|
44
|
+
*journal-manager* is a command-line interface (CLI) application designed for the
|
|
45
|
+
organization of MkDocs notebooks and journals. *journal-manager* facilitates
|
|
46
|
+
the prioritization of learning, one topic and one journal at time.
|
|
47
|
+
|
|
48
|
+
The terminal interface in combination with markdown text reduces distraction and
|
|
49
|
+
improves productivity. *journal-manager* will be a valuable companion on your
|
|
50
|
+
learning quest.
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
$ git clone https://github.com/danoan/journal-manager
|
|
56
|
+
$ cd journal-manager
|
|
57
|
+
$ pip install .
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Setup
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Setup environment variable (e.g. in ~/.bashrc)
|
|
64
|
+
export JOURNAL_MANAGER_CONFIG_FOLDER="~/.config/journal-manager"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
$ jm setup init
|
|
69
|
+
$ Enter the path of your default editor: nvim
|
|
70
|
+
|
|
71
|
+
default_journal_folder=/home/my-user/.config/journal-manager/journals
|
|
72
|
+
default_template_folder=/home/my-user/.config/journal-manager/templates
|
|
73
|
+
journal_data_filepath=/home/my-user/.config/journal-manager/journal_data.toml
|
|
74
|
+
template_data_filepath=/home/my-user/.config/journal-manager/template_data.toml
|
|
75
|
+
|
|
76
|
+
default_text_editor_path=nvim
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Usage
|
|
80
|
+
|
|
81
|
+
### Create and edit journals
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
$ jm journal create "nlp"
|
|
85
|
+
$ jm journal
|
|
86
|
+
nlp:/home/my-user/.config/journal-manager/journals/nlp
|
|
87
|
+
$ jm journal edit nlp
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Create journal-manager template
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
$ jm template register "with-latex" "~/my-journal-manager-templates/with-latex"
|
|
94
|
+
$ jm template
|
|
95
|
+
with-latex:/home/my-user/.config/journal-manager/templates/with-latex
|
|
96
|
+
$ jm journal create "statistics" --template-name "with-latex"
|
|
97
|
+
$ jm journal
|
|
98
|
+
nlp:/home/my-user/.config/journal-manager/journals/nlp
|
|
99
|
+
statistics:/home/my-user/.config/journal-manager/journals/statistics
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Build static web page
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
$ jm build --build-location "~/my-journal-web-page"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Getting started with journal-manager
|
|
2
|
+
|
|
3
|
+
Organize your MkDocs journals with ease, fostering focused learning one topic at a time.
|
|
4
|
+
[Read the docs](https://danoan.github.io/journal-manager/).
|
|
5
|
+
|
|
6
|
+
## What is journal-manager?
|
|
7
|
+
|
|
8
|
+
*journal-manager* is a command-line interface (CLI) application designed for the
|
|
9
|
+
organization of MkDocs notebooks and journals. *journal-manager* facilitates
|
|
10
|
+
the prioritization of learning, one topic and one journal at time.
|
|
11
|
+
|
|
12
|
+
The terminal interface in combination with markdown text reduces distraction and
|
|
13
|
+
improves productivity. *journal-manager* will be a valuable companion on your
|
|
14
|
+
learning quest.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
$ git clone https://github.com/danoan/journal-manager
|
|
20
|
+
$ cd journal-manager
|
|
21
|
+
$ pip install .
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Setup
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Setup environment variable (e.g. in ~/.bashrc)
|
|
28
|
+
export JOURNAL_MANAGER_CONFIG_FOLDER="~/.config/journal-manager"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
$ jm setup init
|
|
33
|
+
$ Enter the path of your default editor: nvim
|
|
34
|
+
|
|
35
|
+
default_journal_folder=/home/my-user/.config/journal-manager/journals
|
|
36
|
+
default_template_folder=/home/my-user/.config/journal-manager/templates
|
|
37
|
+
journal_data_filepath=/home/my-user/.config/journal-manager/journal_data.toml
|
|
38
|
+
template_data_filepath=/home/my-user/.config/journal-manager/template_data.toml
|
|
39
|
+
|
|
40
|
+
default_text_editor_path=nvim
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
### Create and edit journals
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
$ jm journal create "nlp"
|
|
49
|
+
$ jm journal
|
|
50
|
+
nlp:/home/my-user/.config/journal-manager/journals/nlp
|
|
51
|
+
$ jm journal edit nlp
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Create journal-manager template
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
$ jm template register "with-latex" "~/my-journal-manager-templates/with-latex"
|
|
58
|
+
$ jm template
|
|
59
|
+
with-latex:/home/my-user/.config/journal-manager/templates/with-latex
|
|
60
|
+
$ jm journal create "statistics" --template-name "with-latex"
|
|
61
|
+
$ jm journal
|
|
62
|
+
nlp:/home/my-user/.config/journal-manager/journals/nlp
|
|
63
|
+
statistics:/home/my-user/.config/journal-manager/journals/statistics
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Build static web page
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
$ jm build --build-location "~/my-journal-web-page"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "journal-manager"
|
|
7
|
+
version = "1.2"
|
|
8
|
+
description = ""
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { file = "LICENSE.txt" }
|
|
12
|
+
keywords = []
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Daniel Martins Antunes", email = "danoan2008@gmail.com" },
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Programming Language :: Python",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
21
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
22
|
+
]
|
|
23
|
+
dependencies = ["dataclasses", "jinja2", "toml","typing_extensions", "mkdocs", "mkdocs-material", "importlib_resources", "quick-notes", "toml_dataclass"]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Documentation = "https://github.com/danoan/journal-manager#readme"
|
|
27
|
+
Issues = "https://github.com/danoan/journal-manager/issues"
|
|
28
|
+
Source = "https://github.com/danoan/journal-manager"
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
jm = "danoan.journal_manager.cli.cli:main"
|
|
32
|
+
|
|
33
|
+
# -------------------- build backend --------------------
|
|
34
|
+
[tools.setuptools]
|
|
35
|
+
include-package-data = true
|
|
36
|
+
|
|
37
|
+
[tool.setuptools.packages.find]
|
|
38
|
+
where = ["src"]
|
|
39
|
+
include = ["danoan*"]
|
|
40
|
+
namespaces = true
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# -------------------- code test --------------------
|
|
44
|
+
# Using this key instead of tool.pytest is
|
|
45
|
+
# temporary until transition to pyproject.toml
|
|
46
|
+
# is completed: https://docs.pytest.org/en/6.2.x/customize.html
|
|
47
|
+
[tool.pytest.ini_options]
|
|
48
|
+
minversion = "6.0"
|
|
49
|
+
addopts = "--cov --strict-markers"
|
|
50
|
+
xfail_strict = true
|
|
51
|
+
testpaths = [
|
|
52
|
+
"tests"
|
|
53
|
+
]
|
|
54
|
+
pythonpath = [
|
|
55
|
+
"test" # Needed in order to import conftest.py in test modules
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
# -------------------- code coverage --------------------
|
|
59
|
+
# In order to make coverage read from pyproject.toml
|
|
60
|
+
# you should installed as: `pip install coverage[toml]`
|
|
61
|
+
# https://coverage.readthedocs.io/en/latest/config.html
|
|
62
|
+
[tool.coverage.run]
|
|
63
|
+
# I've setup this to false because coverage was returning an error while
|
|
64
|
+
# executing test_build.py. It is not ideal because it is nice to know which
|
|
65
|
+
# conditional paths in the code I am not covering. The error was:
|
|
66
|
+
# coverage.exceptions.DataError: Can't combine line data with arc data
|
|
67
|
+
branch = false
|
|
68
|
+
source = [
|
|
69
|
+
"danoan.journal_manager"
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
[tool.coverage.paths]
|
|
73
|
+
source = [
|
|
74
|
+
"src/danoan/journal_manager",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[tool.coverage.report]
|
|
78
|
+
show_missing = true
|
|
79
|
+
skip_covered = true
|
|
80
|
+
omit = [
|
|
81
|
+
"src/danoan/journal_manager/cli/cli.py"
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# -------------------- code formatting --------------------
|
|
86
|
+
[tool.black]
|
|
87
|
+
line-length = 80
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# -------------------- type checking --------------------
|
|
91
|
+
[tool.mypy]
|
|
92
|
+
python_version = 3.8
|
|
93
|
+
warn_unused_configs = true
|
|
94
|
+
show_error_context = true
|
|
95
|
+
pretty = true
|
|
96
|
+
namespace_packages = true
|
|
97
|
+
check_untyped_defs = true
|
|
98
|
+
ignore_missing_imports = true # libraries without py.typed marker raises an error if this is set to false
|
|
99
|
+
mypy_path = "src:test" # To make sure all intra-package references are tested. Without that, a module is tested on itself. Imports are not considered.
|
|
100
|
+
explicit_package_bases = true # To solve import conflicts of mypy
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
+
|
|
5
|
+
INPUT_FOLDER="${SCRIPT_PATH}/input"
|
|
6
|
+
OUTPUT_FOLDER="${SCRIPT_PATH}/output"
|
|
7
|
+
|
|
8
|
+
mkdir -p "${OUTPUT_FOLDER}"
|
|
9
|
+
|
|
10
|
+
TEMP_BUILD_FOLDER="${OUTPUT_FOLDER}/build"
|
|
11
|
+
rm -rf "${TEMP_BUILD_FOLDER}"
|
|
12
|
+
mkdir -p "${TEMP_BUILD_FOLDER}"
|
|
13
|
+
|
|
14
|
+
MODIFIED_FILE="$1"
|
|
15
|
+
|
|
16
|
+
LIST_OF_MONITORED_FOLDERS=()
|
|
17
|
+
{% for journal_files_folder in data.journals_files_folder %}
|
|
18
|
+
LIST_OF_MONITORED_FOLDERS+=("{{journal_files_folder}}")
|
|
19
|
+
{% endfor %}
|
|
20
|
+
|
|
21
|
+
for FOLDER in "${LIST_OF_MONITORED_FOLDERS[@]}"; do
|
|
22
|
+
MODIFIED_FILE_PREFIX_REMOVED="${MODIFIED_FILE#${FOLDER}/}"
|
|
23
|
+
|
|
24
|
+
if [[ ! ${MODIFIED_FILE} = ${MODIFIED_FILE_PREFIX_REMOVED} ]]; then
|
|
25
|
+
JOURNAL_FOLDER_PATH="${FOLDER%*${MODIFIED_FILE_PREFIX_REMOVED}}"
|
|
26
|
+
JOURNAL_FOLDER_NAME="$(basename "${JOURNAL_FOLDER_PATH}")"
|
|
27
|
+
|
|
28
|
+
if [[ -n "${JOURNAL_FOLDER_NAME}" ]]; then
|
|
29
|
+
break
|
|
30
|
+
fi
|
|
31
|
+
fi
|
|
32
|
+
done
|
|
33
|
+
|
|
34
|
+
JOURNALS_SITE_FOLDER="{{data.journals_site_folder}}"
|
|
35
|
+
|
|
36
|
+
if [ -n ${JOURNAL_FOLDER_NAME} ]; then
|
|
37
|
+
|
|
38
|
+
JOURNAL_LOCATION_FOLDER="${JOURNAL_FOLDER_PATH}"
|
|
39
|
+
echo "Rebuilding: ${JOURNAL_LOCATION_FOLDER}"
|
|
40
|
+
|
|
41
|
+
jm b --ignore-safety-questions --do-not-build-index --build-location "${TEMP_BUILD_FOLDER}" --jl "${JOURNAL_LOCATION_FOLDER}"
|
|
42
|
+
|
|
43
|
+
rm -rf "${JOURNALS_SITE_FOLDER}/${JOURNAL_FOLDER_NAME}"
|
|
44
|
+
mv -f "${TEMP_BUILD_FOLDER}/site/${JOURNAL_FOLDER_NAME}" "${JOURNALS_SITE_FOLDER}"
|
|
45
|
+
|
|
46
|
+
fi
|
journal_manager-1.2/src/danoan/journal_manager/assets/templates/file-monitor/file-monitor.tpl.sh
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
+
|
|
5
|
+
function handler_signal_int() {
|
|
6
|
+
echo "Exiting file-monitor"
|
|
7
|
+
exit 0
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
trap handler_signal_int SIGINT
|
|
11
|
+
|
|
12
|
+
LIST_OF_MONITORED_FILES=()
|
|
13
|
+
{% for journal_files_folder in data.journals_files_folder %}
|
|
14
|
+
echo "Folder: {{journal_files_folder}}"
|
|
15
|
+
while read -r FILE_PATH; do
|
|
16
|
+
LIST_OF_MONITORED_FILES+=("${FILE_PATH}")
|
|
17
|
+
done < <(find "{{journal_files_folder}}" -type f)
|
|
18
|
+
{% endfor %}
|
|
19
|
+
|
|
20
|
+
# echo "Monitored Files: ${LIST_OF_MONITORED_FILES[@]}"
|
|
21
|
+
|
|
22
|
+
while true; do
|
|
23
|
+
echo "Directory has changed!"
|
|
24
|
+
# find "{{data.journals_files_folder}}" -type f | entr -n -d "${SCRIPT_PATH}/file-monitor-action.sh" /_
|
|
25
|
+
for FILE in ${LIST_OF_MONITORED_FILES[@]}; do
|
|
26
|
+
echo "${FILE}"
|
|
27
|
+
done | entr -n -d "${SCRIPT_PATH}/file-monitor-action.sh" /_
|
|
28
|
+
done
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const promisify = require('util').promisify;
|
|
2
|
+
const execFile = require('child_process').execFile;
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fileURLToPath = require('url').fileURLToPath;
|
|
5
|
+
const express = require('express');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const app = express();
|
|
9
|
+
const p_execFile = promisify(execFile);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const port = 4960;
|
|
13
|
+
const HTTP_SERVER_ROOT = path.resolve(__dirname);
|
|
14
|
+
const PROJECT_ROOT = path.dirname(HTTP_SERVER_ROOT);
|
|
15
|
+
|
|
16
|
+
app.use('/',express.static(`${PROJECT_ROOT}/site`));
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
//Not able to make it work inside a container when specifying the hostname
|
|
20
|
+
app.listen(port, () => {
|
|
21
|
+
console.log(`Server running at http://localhost:${port}`);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
width="34.059692mm"
|
|
4
|
+
height="29.496561mm"
|
|
5
|
+
viewBox="0 0 34.059692 29.496561"
|
|
6
|
+
version="1.1"
|
|
7
|
+
id="svg5"
|
|
8
|
+
xml:space="preserve"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
11
|
+
<g id="layer1" transform="translate(-23.830325,-108.39921)">
|
|
12
|
+
<path d="m 40.860173,137.89577 -8.514924,-14.74828 -8.514924,-14.74828 17.029847,0 17.029847,0 -8.514923,14.74828 z"/>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|