secure-77 / Perlite

A web-based markdown viewer optimized for Obsidian

Home Page:https://perlite.secure77.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request for composer and namespace support

selfiens opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
I think composer and namespace support would be great for collaborative development.
However, this repository does not utilize composer or namespace.

Describe the solution you'd like

  • Add composer support and move PHP dependencies to composer.json. The folder structure may need to be changed in order to place the vendor folder in an appropriate location.
  • Migrate the original sources to have namespaces.
  • It would be great to import autoload.php in index.php, and avoid direct inclusion of any other PHP file with require or include statements.

Thank you very much for sharing your creation with the public. I believe that this repository would gain more collaboration with these added supports.

commented

Hi @selfiens,

Thank you for your feedback. Using composer sounds reasonable. I will put this on my to do list but as I have never done this before I need some time to get familiar how this works and then adjust the repo to fit the requirements.

commented

I have added composer support in the version 1.5.5. Unfortunately some of the js libraries come with a lots of child dependencies which I don't want to include in the repository, so I decided to create a script (build.sh), which copies only the necessary files to the correct locations.

For the one php dependency (Parsedown) I decided to do the same, but after running the script it is easy to uncomment the require line in the PerliteParsedown.php which will then use the autoload.php file from the vendor folder.

Please let me know if there is a better way for this setup