Giter Site home page Giter Site logo

legostormtroopr / aristotle-glossary Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aristotle-mdr/aristotle-glossary

1.0 3.0 0.0 67 KB

The Aristotle Glossary extension provides a mechanism for defining reusable terms and the rich text plugins for inserting these into object definitions.

Python 69.62% HTML 11.77% JavaScript 16.08% CSS 2.53%

aristotle-glossary's Introduction

Aristotle Glossary Extensions

https://travis-ci.org/aristotle-mdr/aristotle-glossary.svg?branch=master

The Aristotle Glossary Extension provides additional models for defining reusable terms and a rich text plugins for inserting references into object definitions.

Quick start

  1. Add "aristotle_glossary" to your INSTALLED_APPS setting:

    INSTALLED_APPS = (
        ...
        'aristotle_mdr',
        'aristotle_glossary',
        ...
    )
    
  2. Include the glossary URL definitions in your Django URLconf file. The glossary URLs Must exist at /glossary/ for the glossary definition popovers to work.:

    url(r'^glossary/', include('aristotle_glossary.urls')),
    
  3. Include links in your HTML to ensure the javascript and CSS are loaded for the popovers. This can be done by creating a new local template for your project based on the aristotle_mdr/scripts.py template. More information on how to override files in the Aristotle Metadata Registry documentation on customisation

    <script src="{% static 'aristotle_glossary/aristotle.glossary.js' %}" type="text/javascript"></script>
    <link rel="stylesheet" href="{% static 'aristotle_glossary/aristotle.glossary.css' %}" />
    
  4. Update the CONTENT_EXTENSIONS list in the ARISTOTLE_SETTINGS dictionary in your settings.py file to let the registry know of the additional model. For example:

    ARISTOTLE_SETTINGS['CONTENT_EXTENSIONS'] = [
            'aristotle_glossary',
            # ... other models here based on your requirements
        ]
    
  5. (Optional) Override the CKEDITOR_CONFIGS configuration dictionary to include a button in the rich text editor for in inserting links to glossary items. This can be done either by using the default Aristotle glossary configuration:

    from aristotle_glossary.settings import CKEDITOR_CONFIGS
    

    or manually by:

        CKEDITOR_CONFIGS = {
            'default': {
                'toolbar' : [
                        # ... other configuration options
                       { 'name': 'aristotletoolbar', 'items': [ 'Glossary' ] },
                ],
                'extraPlugins' : 'aristotle_glossary',
            },
        }
    
    For more information on customising the CKeditor toolbar consult the
    `Django-CKEditor documentation<https://github.com/django-ckeditor/django-ckeditor>`_.
    
  6. Run python manage.py migrate to update the database to include the models for the glossary.

Screenshots

A complete glossary

https://cloud.githubusercontent.com/assets/2173174/7443527/8b439c18-f195-11e4-8a97-9286a15983b5.png

Inserting a term into an existing description:

https://cloud.githubusercontent.com/assets/2173174/7443530/b9d333f4-f195-11e4-8ed7-f8c52f0e958a.png

When inserted into an item, hovering gives a brief description:

https://cloud.githubusercontent.com/assets/2173174/7443535/e67ae5c8-f195-11e4-8595-afd2833d901d.png

Clicking the link then takes a user to the complete glossary term:

https://cloud.githubusercontent.com/assets/2173174/7443526/52f433c2-f195-11e4-8b31-7dca1f024d1c.png

aristotle-glossary's People

Contributors

legostormtroopr avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.