Code Monkey home page Code Monkey logo

hpfem.org's Introduction

Intro
-----

These are the sources of the http://hpfem.org/ web.

We welcome any suggestions for our pages, feel free to send us a patch.
Follow the instructions below to edit the pages.

How to edit the pages
---------------------

Please edit only the templates in the directory "templates", and then just run
"./generate" from the root directory and it will take the templates and
generate the .html files. The "./generate" script depends on the jinja2 library
(on Debian/Ubuntu, install the "python-jinja2" package).

For example, if you look into templates/hermes.html:

{% extends "layout.html" %}

{% block title %}
hp-FEM: Hermes project
{% endblock %}

{% block content %}
        <h1 class="heading">Hermes project</h1>
                <p><strong>Hermes</strong> is a free C++/Python
library of adaptive hp-FEM algorithms.
                The following links will lead you to the 1D, 2D and 3D
versions of the library:
                <ul>
                        <li><a href="#">Hermes1D</a> (not available yet)</li>
                        <li><a
href="http://hpfem.math.unr.edu/projects/hermes2d">Hermes2D</a></li>
                        <li><a
href="http://hpfem.math.unr.edu/bugs/projects/show/hermes3d">Hermes3D</a></li>
                </ul>
{% endblock %}


Then you can see, that it takes layout.html (which is the whole html that you
can download from freetemplates.org) a and it only changes the title and the
content.  So the contens is now only edited at one place in
templates/layout.html, then you run "./generate" and it will updated all pages.

When you want to add/delete a new page, then just create/delete a template and
add/delete it's name from ./generate:

#! /usr/bin/env python

from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('templates'))

templates = ["hermes.html", "contact.html", "femcodes.html", "index.html"]

for template in templates:
    t = env.get_template(template)
    open(template, "w").write(t.render())


Add/delete it from the list "templates".

hpfem.org's People

Contributors

certik avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.