<p>This is not the most basic <code>setup.py</code> that is strictly necessary, but instead a more full, ideal <code>setup.py</code> that will help your plugin be discovered and and understood most easily. Note that is assumes there is a <code>README.md</code> file, and that <code>name</code> and <code>description</code> are defined in your plugin's <code>.py</code> module file, which is their preferred location for Lektor.</p>
<h2id="publishing">Publishing</h2><p>Once you augmented your <code>setup.py</code> you can go ahead with the publishing. First
you need to make sure you have a PyPI account. If you do not, you can
create one at <ahref="https://pypi.python.org/pypi?%3Aaction=register_form"class="ext">pypi.python.org</a>.</p>
<p>Once you have done that, you can publish the plugin from the command line
with the <code>lektor</code> command:</p>
<pre><code>$ cd path/to/your/plugin
$ lektor dev publish-plugin
</code></pre>
<p>When you use this for the first time it will prompt you for your login
credentials for <code>pypi</code>. Next time it will have remembered them.</p>
<h2id="listing-on-this-site">Listing on this site</h2><h3id="guide">Guide</h3><p>We'd love to see your new plugin listed on <ahref="/plugins"class="ref">our plugins page</a>. To do that, submit a pull request to <ahref="https://github.com/lektor/lektor-website"class="ext">this repository</a> that adds your plugin as a sub-page of /plugins. To have your plugin page look it's best and be found more easily here and on <ahref="https://pypi.org/"class="ext">PyPI</a>, please <ahref="https://packaging.python.org/tutorials/distributing-packages/"class="ext">fill out your setup.py</a> completely (as in <ahref="/docs/plugins/publishing/#enhance-your-setup.py"class="ref">the above snippet</a>), including</p>
<ul>
<li><code>author</code> and <code>author_email</code></li>
<li><code>classifiers</code>, (optional) such as<ul>
<li><code>Framework :: Lektor</code>,</li>
<li><code>Environment :: Web Environment</code>,</li>
<li><code>Environment :: Plugins</code>,</li>
<li><code>License :: OSI Approved :: [X] License</code> (substitute your license),</li>
</ul>
</li>
<li><code>keywords</code> (optional),</li>
<li><code>long_description</code> and <code>long_description_content_type</code>,</li>
<li><code>project_urls</code> (optional),</li>
<li><code>url</code> to link to your repository on GitHub</li>
</ul>
<divclass="admonition admonition-note"><p>Using Markdown for a <code>long_description</code> is new functionality of PyPI as of <ahref="https://dustingram.com/articles/2018/03/16/markdown-descriptions-on-pypi"class="ext">March 16, 2018</a> that requires <code>setuptools>=38.6.0</code>, <code>twine>=1.11.0</code>, and <code>wheel>=0.31.0</code> if you're using wheels.</p></div><p>The <code>long_description</code> is required to have a page on getlektor.com and PyPI that looks filled out. We process it the same way PyPI does, so if it looks good there it should look good on this site. This means that if you chose to have a Markdown README instead of reStructuredText, you will also need the appropriate <code>long_description_content_type</code>. We pull most of this data from PyPI, so if the plugin's setup.py's changes are not published, neither site will update. We update on build which happens at least daily. We also pull some information from GitHub when the <code>url</code> field is set to the plugin's GitHub project page.</p>
<p>When you submit your pull request, be sure to add some tags. Tags are used on this site to help navigation and discovery of plugins. These are not the same as keywords in your <code>setup.py</code>, which are used on PyPI. Specifically, at least include tags for the plugin events that your plugin hooks, such as <code>setup-env</code>. These in particular will help new plugin developers learn how to interact with these hooks by example.</p>
<h3id="requirements">Requirements</h3><p>Please follow the above guide to get your plugin page on this site and looking it's best. To be clear though, for a new plugin to be listed on this site, the following must be done:</p>
<ol>
<li>The plugin must be available on PyPI.</li>
<li>The plugin's page name on this site is the name of the package on PyPI.</li>
<li>The plugin must be in a category, or else it will not appear anywhere on <ahref="/plugins/"class="ref">the plugins page</a>. New categories are allowed if it makes sense for your plugin.</li>
<li>The plugin must have a long_description and README.</li>
<li>The plugin must have tags. At minimum these should include all plugin events the code uses.</li>
<li><code>name</code> and <code>description</code> must be defined in the plugin's subclass in its <ahref="/docs/plugins/dev/#creating-the-plugin"class="ref">source code</a>. This is needed by for <code>lektor plugins list -v</code> to display appropriate information.</li>
Please enable JavaScript to view the <ahref="https://disqus.com/?ref_noscript"
rel="nofollow">comments powered by Disqus.</a>
</noscript>
</div>
</div>
</div>
</div>
</div>
<divclass="bottomsummary">
<divclass="container">
</div>
</div>
<footer>
<divclass="container">
<divclass="row">
<divclass="col-sm-4 icon-bar">
<ahref="https://github.com/lektor/lektor/"title="Lektor on GitHub"
><iclass="fa fa-github"></i></a>
<ahref="https://github.com/lektor/lektor/issues/"title="Report Issues for Lektor"
><iclass="fa fa-bug"></i></a>
<ahref="https://twitter.com/getlektor"title="Find Lektor on Twitter"
><iclass="fa fa-twitter"></i></a>
<ahref="https://gitter.im/lektor/lektor"title="Chat on Gitter"
><iclass="fa fa-comment"></i></a>
<ahref="https://github.com/lektor/lektor-website/tree/master/content/docs/plugins/publishing/contents.lr"title="View source for this page"><iclass="fa fa-code"></i></a>