An assortment of scripts and programs that pulls in info from our repositories and puts out a website.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.0KB

  1. #! /usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. This file is called by generate.bash and will put out part of our website.
  5. It pulls the info directly from the projects metada dict. Therefore we need this to be a python
  6. script.
  7. The projects themselves are oblivious to any html website format and style. We can change the website
  8. at any time as long as the data structures stay the same.
  9. Output is to stdout, we rely on bash piping in generate.bash to write a file.
  10. We expect a directory "temp" on our level with each project as lowercase name:
  11. temp/fluajho
  12. temp/patroneo
  13. etc.
  14. The image file is a static file. At this point in time manually copied into the static/ dir
  15. """
  16. import sys
  17. project = sys.argv[1]
  18. config = __import__(f"temp.{project}.engine.config", fromlist=["METADATA"])
  19. META = config.METADATA
  20. assert META["shortName"] == project, (META["shortName"], project)
  21. htmlDescription = META["description"].replace("\n\n", "</p>\n\n<p>")
  22. template = f"""<div id="main">
  23. <div class="header">
  24. <h1><img class="pure-img-responsive" src="/images/{META["shortName"]}.png" alt="{META["name"]}"></h1>
  25. </div> <!-- header -->
  26. <div class="content">
  27. <p><img class="pure-img" src="/screenshots/{META["shortName"]}.apng"></p>
  28. <p>{htmlDescription}</p>
  29. <ul>
  30. <li>Current Version: {META["version"]} ({META["year"]})</li>
  31. <li>Multi-Language <a href="/documentation/{META["shortName"]}/">Manual</a></li> <!-- The trailing slash is very important. Otherwise it won't find the images-->
  32. <li>Download: <a href="/downloads/{META["shortName"]}-{META["version"]}.tar.gz">Sourcecode</a> or <a href="/downloads">All Downloads</a></li>
  33. <li>Bugs and Issues: <a href="https://www.laborejo.org/bugs">https://www.laborejo.org/bugs/</a>
  34. <li>Git and Developers README: <a href="http://git.laborejo.org/lss/{META["shortName"]}.git">https://git.laborejo.org/lss/{META["shortName"]}.git</a></li>
  35. </ul>
  36. </div> <!-- content -->
  37. </div> <!-- main -->
  38. """
  39. print (template) #stdout. our job is done