Skip to content

Commit

Permalink
Enhancement: layout and app.ready
Browse files Browse the repository at this point in the history
  • Loading branch information
pylover committed Aug 31, 2024
1 parent 153822c commit 256059c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
9 changes: 4 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Now
- disable text selection on splitter
- readme

## later
- debug: true on deploy
- command line argument to set any option
- all todos
- all fixmes

## later
- readme
- debug: true on deploy
8 changes: 4 additions & 4 deletions yhttp/markdown/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def get(req, path=None):

@app.when
def ready(app):
# metadata (favicon, logo and etc)
if not os.path.isdir(cfg.metadata.physical):
cfg.metadata.physical = os.path.join(here, 'defaultmetadata')

app.excludes = [re.compile(p) for p in cfg.exclude or []]
app.loopkup = TemplateLookup(
directories=[os.path.join(here, 'templates')],
Expand Down Expand Up @@ -201,10 +205,6 @@ def __call__(self, args): # pragma: no cover
host, port = args.bind.split(':')\
if ':' in args.bind else ('localhost', args.bind)

# metadata (favicon, logo and etc)
if not os.path.isdir(cfg.metadata.physical):
cfg.metadata.physical = os.path.join(here, 'defaultmetadata')

app.ready()
httpd = make_server(host, int(port), app)
print(f'Markdown server started at http://{host}:{port}')
Expand Down
8 changes: 8 additions & 0 deletions yhttp/markdown/styles/layout.sass
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,18 @@ aside
padding: 0


aside
-webkit-user-select: none
-ms-user-select: none
user-select: none

#splitter
display: flex
align-items: center
justify-content: center
-webkit-user-select: none
-ms-user-select: none
user-select: none


.icon
Expand Down

0 comments on commit 256059c

Please sign in to comment.