Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved server mode #38

Merged
merged 12 commits into from
Nov 21, 2018
Merged

Improved server mode #38

merged 12 commits into from
Nov 21, 2018

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Nov 19, 2018

Current server mode is bit difficult to use because it requires to access file URL manually. This PR will provide served file list as the directory index. By accessing http://localhost:8080/, marp-cli shows the list of served markdown files.

Screenshot

Currently CLI provides the super-simple file list by using serve-index, but we can improve by our Pug template and SCSS.

I'm going to add a checkbox whether to toggle showing served static files (non-markdown files) in another PR.

?pdf query parameter

The improved server mode no longer recognize the conversion type option like --pdf. We always serve the deck as HTML by default.

Instead, we recognize ?pdf query parameter in accessed URL. You can execute the on-demand PDF conversion while serving HTML. The added directory index has the "PDF" link to trigger it.

http://localhost:8080/index.md?pdf

Default file (index.md or PITCHME.md)

As like as several web server, we recognize index.md as the default page of directory index. It means that you can see the slide deck by accessing http://localhost:8080/ if index.md is placed into the served directory.

If you are familiar to GitPitch, you can also place PITCHME.md to the directory.

ToDo

  • Fix test about server mode

@yhatt yhatt changed the title [WIP] Improved server mode Improved server mode Nov 20, 2018
@yhatt
Copy link
Member Author

yhatt commented Nov 21, 2018

UPDATE: By updating style, more beautiful file list of directory index is ready to use.

screenshot_2018-11-21 screenshot

@yhatt yhatt merged commit 7131ac3 into master Nov 21, 2018
@yhatt yhatt deleted the serve-index branch November 21, 2018 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant