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

Plugin template #320

Closed
wants to merge 37 commits into from
Closed

Conversation

tkliuxing
Copy link
Contributor

Variables, Templates

django-wiki implementation of the MediaWiki template language.

Usage

The article

## Hello {{world|name=Earth}}!

--------------

The template named 'world'

world **{{{name}}}**

--------------

Finally article

## Hello world **Earth**!

@benjaoming benjaoming added this to the 0.1 milestone Oct 26, 2014
@benjaoming
Copy link
Member

Hi @tkliuxing, thanks for the extensive work!!

I will have a look at it after releasing 0.0.24 on Tuesday. We have been cleaning up migrations to start a blank sheet from 0.1. The idea of templates could be on the roadmap for 0.1, but I feel sort of that it would be better to discuss things before implementing them :)

Regarding the idea of templates...

Can the template itself refer to other plugins? And if not, should it? Can it refer to other templates? Is what we are doing actually not just to embed another article, but parametrize the contents of the article?

Let me know what you think, and if you follow what I mean.

On a more practical level...

I know that tests are lacking in many departments. But in order to ensure that your work is well-maintained, would you care to write a couple of basic tests? They can be in wiki.plugins.template.tests.

I see that there are already 3 migrations... I can ensure that the migrations are squashed and included for both South and django.db.migrations.

@tkliuxing
Copy link
Contributor Author

  1. The template itself can refer to other plugins.
  2. The template can embed another article.
  3. Template parameter means I can define one template like "color":
    {: style="color:{{{0}}}"}

use it to everywhere:

    ### Someone{{color|blue}}
    #### Someone{{color|#ff00aa}}

This markdown extension inherit from markdown.preprocessors.Preprocessor, it means template content will embed to origin markdown text.

About tests and migrations, this is what I do next job.

Known Issues:
A template updated but article no change, cause I forget clear the article cache...
But I can fixed it at next PR :D

PS: My native language is Chinese, I can't use English freely. I'm so sorry about that.

@tkliuxing tkliuxing closed this Oct 27, 2014
@tkliuxing tkliuxing reopened this Oct 27, 2014
@tkliuxing
Copy link
Contributor Author

I write a tests , and passed, on python2.7.8 and python3.4.2.

…o use this template without import.

2. Fixed template plugin markdown tag parse error.
3. Improved template plugin list page.
4. Add template plugin admin page.
@coveralls
Copy link

Coverage Status

Coverage decreased (-6.42%) to 49.4% when pulling 7ea2e95 on tkliuxing:plugin_template into 9237dee on django-wiki:master.

@benjaoming benjaoming removed this from the 0.1 milestone Dec 27, 2015
…emplate

* commit '566ceb4e310cbbc7aee3a99a4e1d476ef2053d6c': (75 commits)
  Update news
  Fix django-wiki#496: Clear image floating before heading 1 levels
  Fix django-wiki#428: Do not call str()
  Fix django-wiki#426: Add article raw id field to url path admin and auto-populate articleforobject
  Add reasonable upper bounds to deps, test latest markdown with tox
  Cleanup after Markdown: Remove <p> tag from surrounding <figure>
  handle ValueError coming from querystring input
  Add Django 1.9 to tests and fix errors
  update testproject settings and urls for django 1.9
  fix testproject.urls
  upgrade testproject for dj 1.9, update requirements of tests
  also disable signals in notifications plugin when loading fixtures
  Refactor all model save() to signals. Add tests. Fixes loaddata issues django-wiki#501.
  remove pypandoc for generating readme.rst, it's already there
  Fix migrations django-wiki#472 and update test database
  fix link for wikipedia extensions
  add README contents to docs
  finally some news
  Move badges to the top
  remove README.md and add pandoc-generated README.rst
  ...
@benjaoming benjaoming closed this Jan 19, 2016
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.

None yet

3 participants