Giter Club home page Giter Club logo

xmpp-doap's Introduction

A stylesheet for DOAP files in XMPP software

DOAP ('Description Of A Project') is a specification for describing software projects. It was extended to include implementation status of XEPs in XMPP software, see XEP-0453.

This XSL stylesheet makes DOAP files render nicely in web browsers with XSLT support.

How to use

Reference the stylesheet in your DOAP xml file:

<?xml-stylesheet href="style.xsl" type="text/xsl"?>

That's it!

Most web browsers natively support XSLT, so, people opening your file in a web browser will now see a nice webpage. And computers can easily make sense of the raw XML data which is presented to them in a standardized way.

If you want to adapt the primary color of the rendering to your client, just change the HSL color variables in style.css to your needs:

:root {
    /* Primary color in HSL: Change this to customize all colored elements */
    --color-h: 210;
    --color-s: 13%;
    --color-l: 50%;
}

Sample rendering

How does it look in the end? Have a look at this sample rendering.

Website integration

DOAP files can be rendered in an existing website (e.g. built using Hugo, Doxygen or other systems) by using an <iframe> element.

Prerequisites

How does rendering a DOAP file on my website work? You need:

Adapt files to your needs

A few URLs need to be adapted to your website's structure.

  1. Add the stylesheet to your doap.xml:

    <?xml-stylesheet href="style.xsl" type="text/xsl"?>
  2. Make sure that style.xsl points to where you store style.css on your website:

    <link href="style.css" type="text/css" rel="stylesheet"/>
  3. Optional: Download xeplist.xml from xmpp.org, and reference it in style.xsl:

    <xsl:variable
         name="xeplist"
         select="document('https://your-website.tld/xeplist.xml')/xep-infos"
    />

    Please note: This step is a workaround! Due to a bug in Chromium, XSL files cannot request external resources, even if CORS headers are set correctly. Make sure to update xeplist.xml periodically, until this bug is fixed.

Integrate it with your website

To integrate your DOAP file with your website, you need to add an <iframe> element:

<iframe src="doap.xml" width="100%" frameborder="0">

Since an <iframe>'s height cannot be determined before it is rendered, you can apply this javascript snippet to adjust the frame's height:

function resizeIframe(iframe) {
    iframe.style.height = iframe.contentWindow.document.documentElement.scrollHeight + 20 + 'px';
}

You can either integrate this with your existing javascript, or add it to the frame's onload event:

<iframe src="doap.xml" width="100%" frameborder="0" onload="resizeIframe(this)">

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.