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

Support cgi-bin #34

Open
sc0ttj opened this issue Feb 21, 2019 · 1 comment
Open

Support cgi-bin #34

sc0ttj opened this issue Feb 21, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@sc0ttj
Copy link
Owner

sc0ttj commented Feb 21, 2019

The main scripts should know if they're running in a cgi-bin ..

They should check for $REMOTE_HOST (or something.. look it up).

This could be useful for creating a web based admin interface for managing the site (we could use some other stuff I already made to get that going fairly quickly)..

Also, make Bash on Steroids and SQLite available if running in a cgi-bin..

When building a page, could do something like:

# create a post with Bash on Steroids CGI stuff
new post --with-cgi-backend

# create a post with sqlite3
new post --with-sqlite-backend

# create a post with both Bash on Steroids CGI stuff _and_ sqlite3
new post --with-backend
@sc0ttj sc0ttj added the enhancement New feature or request label Feb 24, 2019
@sc0ttj
Copy link
Owner Author

sc0ttj commented Oct 21, 2019

Make various Mdsh functions available as an API, so we can POST stuff to the functions, and get back the output from the API response..

This could be useful for posting Markdown to mdsh, and getting back the converted output.. Which would pave the way for a nice Admin Panel running in a cgi-bin, via which users could create their pages.

Another use case would be to post JS, CSS (etc) to some endpoint, and get back the minified versions.

How to

Create the dir mdsh/api/, and put Bash-CGI scripts in there as endpoints, which are just wrappers around existing functions like process_markdown, mdsh2md, mo, generate_page_data, etc.

Example: mdsh/api/get-markdown

Post some Markdown to this endpoint, and it will run it through process_markdown and mdsh2md, then return the output.

Usage

Create a basic admin panel, that has:

  • a menu on the left to choose a page or post, or make a new one
  • some input fields to allow add/edit the front matter
  • a big textarea to input the markdown
  • a preview panel/iframe in which the rendered page appears

On updating the text, we can use onChange or onKeyUp on the textarea, to periodically post the textarea contents using AJAX to these endpoints, get the response and add them to the page in a "preview" panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant