Commit 8b147858 authored by coconux's avatar coconux
Browse files

Set labels and display in the doc

parent 021e803f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4,3 +4,5 @@ default_stage: static_tests
icon: 🔐
maintainer: FulcrandG
license: MIT
platforms: GitLab GitHub
benefits: Security, Robustness, Quality, Quality, Quality, Quality, Quality, Quality, Quality
+2 −0
Original line number Diff line number Diff line
@@ -4,3 +4,5 @@ default_stage: static_tests
icon: 🔗
maintainer: Protocole
license: MIT
platforms: GitLab
benefits: Security
+2 −0
Original line number Diff line number Diff line
@@ -4,3 +4,5 @@ default_stage: static_tests
icon: 👁
maintainer: Protocole
license: MIT
platforms: GitLab
benefits: Security
+6 −1
Original line number Diff line number Diff line
@@ -276,6 +276,8 @@ def create_job_doc(job):
    user = get_user(code_owner)
    job_raw_content = get_job_raw_content(job)
    job_icon = conf.get("icon")
    job_platforms = conf.get("platforms")
    job_benefits = conf.get("benefits")

    # Write final file
    try:
@@ -296,7 +298,9 @@ def create_job_doc(job):
                code_owner_url = user["web_url"],
                screenshot_path = screenshot_path,
                screenshots_files = screenshots_files,
                job_raw_content = ''.join(job_raw_content)
                job_raw_content = ''.join(job_raw_content),
                job_platforms = job_platforms,
                job_benefits= job_benefits
        ))
    except Exception as error:
        logging.error("Failed to create final file for job %s", job)
@@ -314,6 +318,7 @@ def add_placeholder():
                template = env.get_template(TEMPLATE_PLACEHOLDER)
                file_handle.write(template.render())


def main():
    """
    Main function
+32 −1
Original line number Diff line number Diff line
# {% if job_icon %} {{ job_icon }} {% endif %} {{ job_name | capitalize }}

<div id="labels">



{% if job_platforms %}
{% set list_platforms = job_platforms.split(',') %}
  {% for platform in list_platforms -%}
  <span class=" " style="display: inline-flex;border-radius: 6px;background-color: springgreen;margin-right: 0.5rem;padding: 0.2rem; margin-bottom:0.4rem;">
    <a class="" data-html="true" data-title="<span class=''>Platform</span><br/>" href="" style="color:white">
      <span class="gl-label-text-scoped " data-container="body" data-html="true">
      {{platform}}
      </span>
    </a>
  </span>
  {% endfor -%}
{% endif %}

{% if job_benefits %}
{% set list_benefits = job_benefits.split(',') %}
  {% for benefit in list_benefits -%}
  <span class=" " style="display: inline-flex;border-radius: 6px;background-color: dodgerblue;margin-right: 0.5rem;padding: 0.2rem; margin-bottom:0.4rem;">
    <a class="" data-html="true" data-title="<span class=''>Benefit</span><br/>" href="" style="color:white">
      <span class="gl-label-text-scoped " data-container="body" data-html="true">
      {{benefit}}
      </span>
    </a>
  </span>
  {% endfor -%}
{% endif %}

</div>

=== "Documentation"

    {{ readme | indent(4, False) }}
@@ -94,4 +126,3 @@ function checkSidebarFade() {
        loadListeners();
}
</script>