markdown-up 3.3.2__tar.gz → 3.3.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown-up
3
- Version: 3.3.2
3
+ Version: 3.3.3
4
4
  Summary: MarkdownUp is a Markdown viewer
5
5
  Author-email: "Craig A. Hobbs" <craigahobbs@gmail.com>
6
6
  License-Expression: MIT
@@ -30,7 +30,13 @@ Dynamic: license-file
30
30
  [![GitHub](https://img.shields.io/github/license/craigahobbs/markdown-up-py)](https://github.com/craigahobbs/markdown-up-py/blob/main/LICENSE)
31
31
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/markdown-up)](https://pypi.org/project/markdown-up/)
32
32
 
33
- MarkdownUp is a Markdown viewer.
33
+ MarkdownUp is a Markdown viewer. This is the MarkdownUp backend application.
34
+
35
+
36
+ ## Links
37
+
38
+ - [MarkdownUp Frontend](https://github.com/craigahobbs/markdown-up#readme)
39
+ - [Source code](https://github.com/craigahobbs/markdown-up-py)
34
40
 
35
41
 
36
42
  ## Install MarkdownUp
@@ -42,7 +48,7 @@ pip install markdown-up
42
48
  ~~~
43
49
 
44
50
 
45
- ## View Markdown Files
51
+ ## View Local Markdown Files
46
52
 
47
53
  To start MarkdownUp, open a terminal and run the `markdown-up` application:
48
54
 
@@ -89,13 +95,14 @@ All Markdown parsing and rendering are done on the client.
89
95
  The `markdown-up` application has the following command-line arguments:
90
96
 
91
97
  ```
92
- usage: markdown-up [-h] [-p N] [-t N] [-n] [-r] [-q] [path]
98
+ usage: markdown-up [-h] [--host HOST] [-p N] [-t N] [-n] [-r] [-q] [path]
93
99
 
94
100
  positional arguments:
95
101
  path the file or directory to view (default is ".")
96
102
 
97
103
  options:
98
104
  -h, --help show this help message and exit
105
+ --host HOST the host address to bind (default is "127.0.0.1"; "0.0.0.0" in release mode)
99
106
  -p, --port N the application port (default is 8080)
100
107
  -t, --threads N the number of web server threads (default is 8)
101
108
  -n, --no-browser don't open a web browser
@@ -106,32 +113,29 @@ options:
106
113
 
107
114
  ## MarkdownUp Applications
108
115
 
109
- With MarkdownUp, you can write client-rendered frontend applications using
110
- [BareScript](https://craigahobbs.github.io/bare-script/language/).
111
- MarkdownUp applications are created by adding `markdown-script` fenced code blocks containing
112
- [BareScript](https://craigahobbs.github.io/bare-script/language/)
113
- to a Markdown file and viewing it with the MarkdownUp frontend application. When the Markdown file
114
- is rendered, the BareScript is executed and its results are rendered in place. For example:
116
+ MarkdownUp applications are Markdown files that contain code. Add a `markdown-script` fenced code
117
+ block of [BareScript](https://craigahobbs.github.io/bare-script/language/) to any Markdown file, and
118
+ when MarkdownUp renders the file, it runs the script and renders its output in place of the code
119
+ block. For example:
115
120
 
116
121
  ~~~markdown
117
- # Frontend Hello World
122
+ # Hello World
118
123
 
119
124
  ```markdown-script
120
125
  markdownPrint('Hello, **World**!!')
121
126
  ```
122
127
  ~~~
123
128
 
129
+ Applications run entirely in the browser, so no server-side code is required. Use the following
130
+ resources to learn more:
124
131
 
125
- ### MarkdownUp Application Reference
126
-
127
- [The BareScript Language](https://craigahobbs.github.io/bare-script/language/)
128
-
129
- [The BareScript Library](https://craigahobbs.github.io/bare-script/library/)
130
-
131
- [MarkdownUp Frontend Examples](https://craigahobbs.github.io/#var.vPage='MarkdownUp')
132
+ - [The BareScript Language](https://craigahobbs.github.io/bare-script/language/)
133
+ - [The BareScript Library](https://craigahobbs.github.io/bare-script/library/)
134
+ - [MarkdownUp Application Examples](https://craigahobbs.github.io/#var.vPage='MarkdownUp')
135
+ - [The BareScript Creator](https://craigahobbs.github.io/bare-script-py/creator/)
132
136
 
133
137
 
134
- ### MarkdownUp Backend Applications
138
+ ### Backend Applications
135
139
 
136
140
  To write a backend application in BareScript, use the
137
141
  [bare-script](https://pypi.org/project/bare-script/) package's
@@ -5,7 +5,13 @@
5
5
  [![GitHub](https://img.shields.io/github/license/craigahobbs/markdown-up-py)](https://github.com/craigahobbs/markdown-up-py/blob/main/LICENSE)
6
6
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/markdown-up)](https://pypi.org/project/markdown-up/)
7
7
 
8
- MarkdownUp is a Markdown viewer.
8
+ MarkdownUp is a Markdown viewer. This is the MarkdownUp backend application.
9
+
10
+
11
+ ## Links
12
+
13
+ - [MarkdownUp Frontend](https://github.com/craigahobbs/markdown-up#readme)
14
+ - [Source code](https://github.com/craigahobbs/markdown-up-py)
9
15
 
10
16
 
11
17
  ## Install MarkdownUp
@@ -17,7 +23,7 @@ pip install markdown-up
17
23
  ~~~
18
24
 
19
25
 
20
- ## View Markdown Files
26
+ ## View Local Markdown Files
21
27
 
22
28
  To start MarkdownUp, open a terminal and run the `markdown-up` application:
23
29
 
@@ -64,13 +70,14 @@ All Markdown parsing and rendering are done on the client.
64
70
  The `markdown-up` application has the following command-line arguments:
65
71
 
66
72
  ```
67
- usage: markdown-up [-h] [-p N] [-t N] [-n] [-r] [-q] [path]
73
+ usage: markdown-up [-h] [--host HOST] [-p N] [-t N] [-n] [-r] [-q] [path]
68
74
 
69
75
  positional arguments:
70
76
  path the file or directory to view (default is ".")
71
77
 
72
78
  options:
73
79
  -h, --help show this help message and exit
80
+ --host HOST the host address to bind (default is "127.0.0.1"; "0.0.0.0" in release mode)
74
81
  -p, --port N the application port (default is 8080)
75
82
  -t, --threads N the number of web server threads (default is 8)
76
83
  -n, --no-browser don't open a web browser
@@ -81,32 +88,29 @@ options:
81
88
 
82
89
  ## MarkdownUp Applications
83
90
 
84
- With MarkdownUp, you can write client-rendered frontend applications using
85
- [BareScript](https://craigahobbs.github.io/bare-script/language/).
86
- MarkdownUp applications are created by adding `markdown-script` fenced code blocks containing
87
- [BareScript](https://craigahobbs.github.io/bare-script/language/)
88
- to a Markdown file and viewing it with the MarkdownUp frontend application. When the Markdown file
89
- is rendered, the BareScript is executed and its results are rendered in place. For example:
91
+ MarkdownUp applications are Markdown files that contain code. Add a `markdown-script` fenced code
92
+ block of [BareScript](https://craigahobbs.github.io/bare-script/language/) to any Markdown file, and
93
+ when MarkdownUp renders the file, it runs the script and renders its output in place of the code
94
+ block. For example:
90
95
 
91
96
  ~~~markdown
92
- # Frontend Hello World
97
+ # Hello World
93
98
 
94
99
  ```markdown-script
95
100
  markdownPrint('Hello, **World**!!')
96
101
  ```
97
102
  ~~~
98
103
 
104
+ Applications run entirely in the browser, so no server-side code is required. Use the following
105
+ resources to learn more:
99
106
 
100
- ### MarkdownUp Application Reference
101
-
102
- [The BareScript Language](https://craigahobbs.github.io/bare-script/language/)
103
-
104
- [The BareScript Library](https://craigahobbs.github.io/bare-script/library/)
105
-
106
- [MarkdownUp Frontend Examples](https://craigahobbs.github.io/#var.vPage='MarkdownUp')
107
+ - [The BareScript Language](https://craigahobbs.github.io/bare-script/language/)
108
+ - [The BareScript Library](https://craigahobbs.github.io/bare-script/library/)
109
+ - [MarkdownUp Application Examples](https://craigahobbs.github.io/#var.vPage='MarkdownUp')
110
+ - [The BareScript Creator](https://craigahobbs.github.io/bare-script-py/creator/)
107
111
 
108
112
 
109
- ### MarkdownUp Backend Applications
113
+ ### Backend Applications
110
114
 
111
115
  To write a backend application in BareScript, use the
112
116
  [bare-script](https://pypi.org/project/bare-script/) package's
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "markdown-up"
7
- version = "3.3.2"
7
+ version = "3.3.3"
8
8
  description = "MarkdownUp is a Markdown viewer"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -29,6 +29,8 @@ def main(argv=None):
29
29
  parser = argparse.ArgumentParser(**argument_parser_args)
30
30
  parser.add_argument('path', nargs='?', default='.',
31
31
  help='the file or directory to view (default is ".")')
32
+ parser.add_argument('--host', metavar='HOST',
33
+ help='the host address to bind (default is "127.0.0.1"; "0.0.0.0" in release mode)')
32
34
  parser.add_argument('-p', '--port', metavar='N', type=int, default=8080,
33
35
  help='the application port (default is 8080)')
34
36
  parser.add_argument('-t', '--threads', metavar='N', type=int, default=8,
@@ -57,8 +59,13 @@ def main(argv=None):
57
59
  if root == '':
58
60
  root = '.'
59
61
 
60
- # Construct the URL
61
- host = '127.0.0.1'
62
+ # Determine the host address to bind. By default, only release mode is reachable from other machines.
63
+ bind_host = args.host or ('0.0.0.0' if args.release else '127.0.0.1')
64
+
65
+ # Construct the URL - an any-address bind is viewed at its loopback address
66
+ host = {'0.0.0.0': '127.0.0.1', '::': '::1'}.get(bind_host, bind_host)
67
+ if ':' in host:
68
+ host = f'[{host}]'
62
69
  if is_file:
63
70
  path_base = os.path.basename(args.path)
64
71
  path_root, path_ext = os.path.splitext(path_base)
@@ -82,7 +89,7 @@ def main(argv=None):
82
89
  # Host the application
83
90
  if not args.quiet:
84
91
  print(f'markdown-up: Serving at {url} ...')
85
- waitress.serve(wsgiapp_wrap, port=args.port, threads=max(1, args.threads))
92
+ waitress.serve(wsgiapp_wrap, host=bind_host, port=args.port, threads=max(1, args.threads))
86
93
 
87
94
 
88
95
  # WSGI application wrapper and the start_response function so we can log status and environ
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown-up
3
- Version: 3.3.2
3
+ Version: 3.3.3
4
4
  Summary: MarkdownUp is a Markdown viewer
5
5
  Author-email: "Craig A. Hobbs" <craigahobbs@gmail.com>
6
6
  License-Expression: MIT
@@ -30,7 +30,13 @@ Dynamic: license-file
30
30
  [![GitHub](https://img.shields.io/github/license/craigahobbs/markdown-up-py)](https://github.com/craigahobbs/markdown-up-py/blob/main/LICENSE)
31
31
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/markdown-up)](https://pypi.org/project/markdown-up/)
32
32
 
33
- MarkdownUp is a Markdown viewer.
33
+ MarkdownUp is a Markdown viewer. This is the MarkdownUp backend application.
34
+
35
+
36
+ ## Links
37
+
38
+ - [MarkdownUp Frontend](https://github.com/craigahobbs/markdown-up#readme)
39
+ - [Source code](https://github.com/craigahobbs/markdown-up-py)
34
40
 
35
41
 
36
42
  ## Install MarkdownUp
@@ -42,7 +48,7 @@ pip install markdown-up
42
48
  ~~~
43
49
 
44
50
 
45
- ## View Markdown Files
51
+ ## View Local Markdown Files
46
52
 
47
53
  To start MarkdownUp, open a terminal and run the `markdown-up` application:
48
54
 
@@ -89,13 +95,14 @@ All Markdown parsing and rendering are done on the client.
89
95
  The `markdown-up` application has the following command-line arguments:
90
96
 
91
97
  ```
92
- usage: markdown-up [-h] [-p N] [-t N] [-n] [-r] [-q] [path]
98
+ usage: markdown-up [-h] [--host HOST] [-p N] [-t N] [-n] [-r] [-q] [path]
93
99
 
94
100
  positional arguments:
95
101
  path the file or directory to view (default is ".")
96
102
 
97
103
  options:
98
104
  -h, --help show this help message and exit
105
+ --host HOST the host address to bind (default is "127.0.0.1"; "0.0.0.0" in release mode)
99
106
  -p, --port N the application port (default is 8080)
100
107
  -t, --threads N the number of web server threads (default is 8)
101
108
  -n, --no-browser don't open a web browser
@@ -106,32 +113,29 @@ options:
106
113
 
107
114
  ## MarkdownUp Applications
108
115
 
109
- With MarkdownUp, you can write client-rendered frontend applications using
110
- [BareScript](https://craigahobbs.github.io/bare-script/language/).
111
- MarkdownUp applications are created by adding `markdown-script` fenced code blocks containing
112
- [BareScript](https://craigahobbs.github.io/bare-script/language/)
113
- to a Markdown file and viewing it with the MarkdownUp frontend application. When the Markdown file
114
- is rendered, the BareScript is executed and its results are rendered in place. For example:
116
+ MarkdownUp applications are Markdown files that contain code. Add a `markdown-script` fenced code
117
+ block of [BareScript](https://craigahobbs.github.io/bare-script/language/) to any Markdown file, and
118
+ when MarkdownUp renders the file, it runs the script and renders its output in place of the code
119
+ block. For example:
115
120
 
116
121
  ~~~markdown
117
- # Frontend Hello World
122
+ # Hello World
118
123
 
119
124
  ```markdown-script
120
125
  markdownPrint('Hello, **World**!!')
121
126
  ```
122
127
  ~~~
123
128
 
129
+ Applications run entirely in the browser, so no server-side code is required. Use the following
130
+ resources to learn more:
124
131
 
125
- ### MarkdownUp Application Reference
126
-
127
- [The BareScript Language](https://craigahobbs.github.io/bare-script/language/)
128
-
129
- [The BareScript Library](https://craigahobbs.github.io/bare-script/library/)
130
-
131
- [MarkdownUp Frontend Examples](https://craigahobbs.github.io/#var.vPage='MarkdownUp')
132
+ - [The BareScript Language](https://craigahobbs.github.io/bare-script/language/)
133
+ - [The BareScript Library](https://craigahobbs.github.io/bare-script/library/)
134
+ - [MarkdownUp Application Examples](https://craigahobbs.github.io/#var.vPage='MarkdownUp')
135
+ - [The BareScript Creator](https://craigahobbs.github.io/bare-script-py/creator/)
132
136
 
133
137
 
134
- ### MarkdownUp Backend Applications
138
+ ### Backend Applications
135
139
 
136
140
  To write a backend application in BareScript, use the
137
141
  [bare-script](https://pypi.org/project/bare-script/) package's
File without changes
File without changes