diff --git a/README.md b/README.md index 8cc77294..ee5b6740 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,41 @@ It is built on Jekyll and GitHub pages for backend / hosting, tailtwindcss for d [![Netlify Status](https://api.netlify.com/api/v1/badges/f84340d0-bc2f-4f7f-ad4c-877c50b33a27/deploy-status)](https://app.netlify.com/sites/inventree-org-preview/deploys) -## Architecture +## Adding a plugin to the list -The website consists of content, layouts and assets. Jekyll runs and builds out of these files static html files - that are then hosted on GitHub pages. Folders with an underscore prefixed are internal folders for Jekyll, folders without are rendered as subdirectories in the output. +Any maintainer of a plugin can add their plugin to the list. The plugin will be listed on the website, we might provide a mechanism to discover plugins from within InvenTree in the future. -Content: +To add a plugin the following steps are required: +- Fork the repository +- Create a new branch. We recommend `plugin/` as the branch name. +- Create a new file in `_repo`. We recommend using the package name as the file name. +- Copy the content from `_repo/template.md` into the new file. +- Fill out the details. Please make sure to use the correct format for the fields. +- If this is your first contribution to the list, please add yourself to the `_publishers` folder. + - Use your GitHub username as the file name. + - Copy the content from `_publishers/_template.md` into the new file. + - Fill out the details. Please make sure to use the correct format for the fields. +- Commit your changes and create a pull request. We recommend using the title `[REPO] Add plugin `. + +Please note that the plugin list is moderated as we see fit and we reserve the right to reject plugins that do not meet basic quality standards. We will try to provide feedback in the pull request if that is the case. + +As a maintainer of a plugin we count on you to keep the information up to date. If you want to update the information, please create a pull request. +The plugin list is just getting started as a static collection, we might enhance the features in the future. If we need more information or make significant changes to the list, we will ping the maintainers via their GitHub handle - so please keep your main GitHub handle up to date in your publisher file. + +## Architecture and development + +The website consists of content, layouts and assets. Jekyll runs and builds out of these files static html files - that are then hosted on GitHub pages. + +### Folders and files +Folders with an underscore prefixed are internal folders for Jekyll, folders without are rendered as subdirectories in the output. + +Structure: `_data` contains data that is references on pages `_drafts` contains drafts for blog pages and news items `_news` contains news entries `_posts` contains blog entries -`_publishers` contains authors/publishers -`_repo` will contain plugin repo entries +`_publishers` contains authors/publishers of blog entries, news items and plugins +`_repo` contains plugin repo entries Layouts: `_includes` contains partials that can be used in layouts @@ -27,9 +51,16 @@ The site configuration is saved in `config.yaml`, required gems in `Gemfile` and The CSS stylesheet uses tailwindcss and is built with postcss on demand. NodeJs is needed for this. The main css file is located in `assets/index.css`. Rebuilds are handled by the workflows automatically. -## Common commands +### Preview builds + +Once a PR is created, a preview build is created on Netlify. The preview build is available at `https://-inventree-org-preview.netlify.app/`. The preview build is automatically updated when the PR is updated. +A bot will comment on the PR with the link to the preview build. + + +### Common commands for local development Install packages for ruby and nodejs. -``` + +```bash sudo apt-get install rubygems ruby-dev nodejs npm npm install sudo gem install bundler @@ -37,16 +68,13 @@ bundle install ``` Build site locally -``` + +```bash bundle exec jekyll build ``` -Run debug server -``` +Run debug server that automatically updates. This does not recompile the tailwindcss stylesheet. If you change something in the css file, you neet to build the site fully with the command above. + +```bash bundle exec jekyll serve --incremental ``` - -Regenerate file structure -``` -tree -I '_site|.git|.jekyll-cache|node_modules' --dirsfirst -``` diff --git a/_config.yml b/_config.yml index 7031f5d3..1fcd718a 100644 --- a/_config.yml +++ b/_config.yml @@ -13,10 +13,6 @@ deploy-link: internal: deploy.md blog-link: internal: blog.html -plugin-link: - internal: plugins.html -contribute-link: - internal: contribute.md # Hosting parameters baseurl: "" @@ -33,8 +29,7 @@ collections: permalink: "/:title" repo: output: true - custom_permalink_placeholders: ["publisher"] - #permalink: "/:publisher/:title" + permalink: ":doc_author/:title" news: output: true permalink: /news/:year/:month/:day/:title diff --git a/_data/general/footer.yml b/_data/general/footer.yml index 4b8716ce..7289b2ad 100644 --- a/_data/general/footer.yml +++ b/_data/general/footer.yml @@ -8,6 +8,8 @@ site: doc-link - name: News internal: news.html + - name: Plugin List + internal: plugins.html - title: Ecosystem link: diff --git a/_includes/block/plugins.html b/_includes/block/plugins.html new file mode 100644 index 00000000..97cdc027 --- /dev/null +++ b/_includes/block/plugins.html @@ -0,0 +1,19 @@ +
+
+
+

Plugin List

+

+ Explore plugins provided by the community. + Learn More Arrow pointing right +

+
+
+ {% assign filtered_repo = site.repo | sort: 'last-modified-date' | reverse %} + {% for plugin in filtered_repo limit:2 %} +
+ {% include plugin_card.html plugin=plugin %} +
+ {% endfor %} +
+
+
\ No newline at end of file diff --git a/_includes/plugin_card.html b/_includes/plugin_card.html index 07e72ed1..17edf73e 100644 --- a/_includes/plugin_card.html +++ b/_includes/plugin_card.html @@ -1,20 +1,20 @@ -
+ +
- \ No newline at end of file + \ No newline at end of file diff --git a/_layouts/collection/collection_refpage.html b/_layouts/collection/collection_refpage.html new file mode 100644 index 00000000..461960e4 --- /dev/null +++ b/_layouts/collection/collection_refpage.html @@ -0,0 +1,53 @@ +--- +layout: default +--- + +
+

{{page.title}}

+ + +{% assign all_items = "" | split: "/" %} +{% for col_item in site[page.collection] %} + {% for item in col_item[page.reference] %} + {% assign preprocessed = item | strip %} + {% unless preprocessed == "" %} + {% assign all_items = all_items | push: preprocessed %} + {% endunless %} + {% endfor %} +{% endfor %} +{% assign all_items = all_items | uniq | sort %} + +

The full list of plugins is available on the main plugin list page.


+

Click on a name to jump to the plugins that are marked with it.

+ +{% for item in all_items %} + {% unless tag == "" %} + + {{ item }} + + {% endunless %} +{% endfor %} +
+

+ +{% for item in all_items %} + {% unless item == "" %} +
+

{{ item }}

+ +
+ {% for plugin in site[page.collection] %} + {% assign col_items = "" | split: "/" %} + {% for item in plugin[page.reference] %} + {% assign lower_item = item %} + {% assign col_items = col_items | push: lower_item %} + {% endfor %} + {% if col_items contains item %} +
{% include plugin_card.html plugin=plugin %}
+ {% endif %} + {% endfor %} +
+ {% endunless %} +{% endfor %} + +
\ No newline at end of file diff --git a/_layouts/plugin.html b/_layouts/plugin.html index 87d99a35..3edf81f6 100644 --- a/_layouts/plugin.html +++ b/_layouts/plugin.html @@ -4,48 +4,86 @@ notitle: true fullwith: true ---

{{ page.name }} -{% include partial/publisher_ref.html pub=page.publisher %} +{% include partial/publisher_ref.html pub=page.author %} +last modified: {{ page.last-modified-date | date_to_string }}

-
-
+
+
{{ content }}
-

Link section

+

Detail section

+

License: + {% if page.open_source %}{% else %}{% endif %} + {{ page.license }}
+

+ Status: +
{% if page.stable %}Stable{% else %} Unstable{% endif %}
+
{% if page.maintained %}Maintained{% else %} Unmaintained{% endif %}
+
+ {% if page.pypi and page.package_name %}Package on PyPI:
{{ page.package_name }}
{% endif %} +

+ +
+ +

{{ page.website }}

+
+
+ + {% if page.issue_tracker %} + + + {% endif %} + + {% if page.github %} + +
+ +

{{ page.github | remove: "https://github.com/" }}

+
+
+ {% endif %} + {% if page.gitlab %} + +
+ +

{{ page.gitlab | remove: "https://gitlab.com/" }}

+
+
+ {% endif %} + {% if page.source %} + +
+ +

{{ page.source }}

+
+
+ {% endif %}
-

Categories

-
    + +
    {% for categorie in page.categories %} -
  1. {{ categorie }}
  2. + {{ categorie }} {% endfor %} -
+
-

Tags

-
    + +
    {% for tag in page.tags %} -
  1. {{ tag }}
  2. + {{ tag }} {% endfor %} -
+
- -
-

Website

-

{{ page.website }}

- -
-
diff --git a/_layouts/plugin_highlight.html b/_layouts/plugin_highlight.html deleted file mode 100644 index 224d887e..00000000 --- a/_layouts/plugin_highlight.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: content ---- -
- {{ content }} - {% if page.plugin %} -
-

Find out more about this plugin on the plugin site

- {% include plugin_card.html plugin=page.plugin %} - {% endif %} -
diff --git a/_plugins/author_permalink.rb b/_plugins/author_permalink.rb new file mode 100644 index 00000000..81febb1b --- /dev/null +++ b/_plugins/author_permalink.rb @@ -0,0 +1,9 @@ +module Jekyll + module Drops + class UrlDrop < Drop + def doc_author + @obj.data['author'] + end + end + end + end \ No newline at end of file diff --git a/_plugins/hook-add-last-modified-date.rb b/_plugins/hook-add-last-modified-date.rb new file mode 100644 index 00000000..834d39f3 --- /dev/null +++ b/_plugins/hook-add-last-modified-date.rb @@ -0,0 +1,22 @@ +# see https://stackoverflow.com/a/36769049/17860466 + +Jekyll::Hooks.register :posts, :pre_render do |post| + + # get the current post last modified time + modification_time = File.mtime( post.path ) + + # inject modification_time in post's datas. + post.data['last-modified-date'] = modification_time + +end + + +Jekyll::Hooks.register :repo, :pre_render do |repo| + + # get the current post last modified time + modification_time = File.mtime( repo.path ) + + # inject modification_time in post's datas. + repo.data['last-modified-date'] = modification_time + +end \ No newline at end of file diff --git a/_publishers/_template.md b/_publishers/_template.md new file mode 100644 index 00000000..24c3d619 --- /dev/null +++ b/_publishers/_template.md @@ -0,0 +1,7 @@ +--- +short_name: octocat # GitHub username - must be the same as the filename +name: The Octocat # The name/alias/whatever you want to be displayed +github: octocat # Your GitHub username - if you switch to a new account, please update this +website: https://github.blog/ # Your website, twitter, reddit - optional +--- +A cool tagline # A tagline or motivation, optional - please keep it under 200 words \ No newline at end of file diff --git a/_repo/_template.md b/_repo/_template.md new file mode 100644 index 00000000..93b566ad --- /dev/null +++ b/_repo/_template.md @@ -0,0 +1,21 @@ +--- +name: inventree-brother-plugin # Name of the plugin (should be either NAME, TITLE or SLUG) +author: schrodingersgat # Maintainer must be the same as the publisher reference +license: MIT # License, we prefer open source +open_source: true # Is this project licensed with an OSI-approved license - aka 'open source' +stable: true # Is this project stable? Should users deploy this in their instace? +maintained: true # Is this project maintained? +pypi: true # Is availanle via PyPi +package_name: inventree-brother-plugin # Name of the package on the index, required if pypi true +github: https://github.com/inventree/inventree-brother-plugin # Ĺink to repo in GitHub, one of github, gitlab or source is required +gitlab: https://gitlab.com/inventree/inventree-brother-plugin # Ĺink to repo in Gitlab, one of github, gitlab or source is required +source: https://example.com/inventree/inventree-brother-plugin # Link to source, one of github, gitlab or source is required +issue_tracker: https://github.com/inventree/inventree-brother-plugin/issues # Link to Issue tracker, optional +website: https://inventree.org # Website, full path with protocol, optional +categories: # Mixins/integrations that are used, optional + - Label +tags: # Freetext tags - treat them like kewords, optional + - Brother + - Printer +--- +Description text for the plugin goes here. Markdown is supported. You could just reuse the README.md file from your repo. \ No newline at end of file diff --git a/_repo/inventree-apprise.md b/_repo/inventree-apprise.md new file mode 100644 index 00000000..43783b68 --- /dev/null +++ b/_repo/inventree-apprise.md @@ -0,0 +1,38 @@ +--- +name: InvenTree Apprise +author: matmair +license: MIT +open_source: true +stable: true +maintained: true +pypi: true +package_name: inventree-apprise +github: https://github.com/matmair/inventree-apprise +issue_tracker: https://github.com/matmair/inventree-apprise/issues +website: https://mjmair.com +categories: + - Notifications +tags: + - Apprise + - 3rd party integration + - Discord + - IFTTT + - Matrix + - Microsoft Teams + - Slack + - Twilio + - +--- +Send notifications from InvenTree via Apprise + +## Setup + +1. Install this plugin in the webinterface with the packagename `inventree-apprise` + +1. Enable the plugin in the plugin settings. You need to be signed in as a superuser for this. +**The server will restart if you enable the plugin** + +1. Add all endpoints you want to use in the plugin settings. You can use the [Apprise URL Syntax](https://github.com/caronc/apprise#supported-notifications). + +## License +This project is licensed as MIT. Copy and do what you want - maybe tag your new plugin so others can find it. The more the merrier. diff --git a/_repo/shopify.md b/_repo/shopify.md deleted file mode 100644 index 6bb88767..00000000 --- a/_repo/shopify.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -name: ShopifyIntegrationPlugin org -author: matmair -website: https://mjmair.com -github: https://github.com/matmair/ShopifyIntegrationPlugin -categories: - - Integration - - Webhook -tags: - - Shopify - - Orders ---- -A simple Integration into Shopify. - -Let your orders from Shopify be created in autopilot, update your Inventory-Levels from InvenTree and vice-versa. - -## Installation - -1. Navigate to your InvenTree directory and cd into `src/InvenTree/plugins` and execute `git submodule add https://github.com/matmair/ShopifyIntegrationPlugin` there. Enable plugins in the general plugin settings and reload InvenTree. -2. Add a private app to your Shopify store (please register as a dev and use a development store. This is a PoC) -3. Go to the InvenTree settings and fill in the settings for the ShopifyIntegrationPlugin from your new private app. -4. Check out the new navigation tab. - -## Caveat - -Your instance must be reachable for webhooks from Shopify so use ngrok or something like that to expose your instance with HTTPS. - -## State of the code - -This code is bad. It is neither optimized nor is it CI/Cd ready or covered in any way. -I use this Plugin as a PoC to show what will be possible with the new system. - -## Contribute - -The whole plugin system is currently not even in the dev branch. -Feel free to submit issues or just send me a mail to dev AT mjmair.com - - -## No open source? - -Currently I have defined no license so forking is a bad idea copyright-wise. This code should not be used as basis for anything - I will define a license once the plugin system gets released. diff --git a/assets/index.css b/assets/index.css index f90ab969..e142ce6e 100644 --- a/assets/index.css +++ b/assets/index.css @@ -59,6 +59,12 @@ layout: empty visibility: hidden; } + .content a { + color:#111827; + font-weight:500; + text-decoration:underline; + } + .color-link { @apply text-secondary } @@ -79,6 +85,14 @@ layout: empty @apply list-none } + .plugin_cat { + @apply badge bg-yellow-500 whitespace-nowrap + } + + .plugin_tag { + @apply badge bg-blue-400 whitespace-nowrap + } + .max-w-p90 { max-width: 90% } @@ -87,4 +101,15 @@ layout: empty display: block; text-align: center; } + + .plugin_links { + @apply mb-0 italic + } + + .anchor { + display: block; + position: relative; + top: -4.5rem; + visibility: hidden; + } } diff --git a/categories.html b/categories.html new file mode 100644 index 00000000..3a250014 --- /dev/null +++ b/categories.html @@ -0,0 +1,7 @@ +--- +layout: collection/collection_refpage +title: Plugins by Category +collection: repo +permalink: /plugins/categories/ +reference: categories +--- diff --git a/extend/plugin/index.md b/extend/plugin/index.md index 0ef3ff6a..e8d5f0b8 100644 --- a/extend/plugin/index.md +++ b/extend/plugin/index.md @@ -11,12 +11,9 @@ You can read more about the plugin architecture, including information on develo Add *native printing capabilities* for your network connected printers to the webinterface and apps. There are plugins for: - [Brother QL](https://pypi.org/project/inventree-brother-plugin/) - [Zebra](https://github.com/SergeoLacruz/inventree-zebra-plugin) -- [Cups](https://github.com/wolflu05/inventree-cups-plugin) ### Plugin repo -{% include partial/alert.html - style='info' - title='Coming soon' - desc="We are working on a full plugin repo - keep up to date on the blog or directly in your InvenTree dashboard with news." -%} +You can find all tagged plugins on [PyPi](https://pypi.org/search/?q=inventree-plugin) and [GitHub](https://github.com/topics/inventreeplugins). + +We also offer a [plugin repo](../../plugins.html) with a community driven list of plugins. We encourage you to add your own plugins. diff --git a/index.md b/index.md index b4d47658..4c11b637 100644 --- a/index.md +++ b/index.md @@ -22,3 +22,4 @@ main_page: True {% include block/cta.html cta=site.data.ctas.end %} +{% include block/plugins.html %} diff --git a/plugins.html b/plugins.html index 9a1cfb37..db64fa43 100644 --- a/plugins.html +++ b/plugins.html @@ -1,14 +1,22 @@ --- layout: default -title: Plugins +title: Plugin List permalink: /plugins --- - -
-

InvenTree Plugin Repository

+

InvenTree Plugin List

+

+ InvenTree is a modular application and can be extended with plugins. This list is a collection of plugins that have been developed by the community. + Beeing on this list does not mean that the plugin is officially supported by the InvenTree core team. We also do not check for security, privacy or performance issues or compatibility with the latest InvenTree version. +

+ You can also browse for plugins by tags or categories +

+
{% for plugin in site.repo %} +
{% include plugin_card.html plugin=plugin %} +
{% endfor %} +
diff --git a/tags.html b/tags.html new file mode 100644 index 00000000..85273a96 --- /dev/null +++ b/tags.html @@ -0,0 +1,7 @@ +--- +layout: collection/collection_refpage +title: Plugins by Tags +collection: repo +permalink: /plugins/tags/ +reference: tags +--- diff --git a/use/maker.md b/use/maker.md index 3b7a4aba..7f3550c0 100644 --- a/use/maker.md +++ b/use/maker.md @@ -12,5 +12,5 @@ buttons: link: http://example.com - text: lorem ipsum link: - internal: plugins.html + site: plugn-link ---