Giter Club home page Giter Club logo

developer-docs's Introduction

Green Web Foundation - Developer Docs Website

Welcome to the developer documentation site for Green Web Foundation's open-source libraries. Here, you'll find comprehensive guides and resources to help you understand, use, and contribute to our projects effectively.

Getting Started

To work on this site locally, follow these steps:

Prerequisites

Before you begin, make sure you have the following software installed on your machine:

This project is built using the Eleventy (11ty) static site generator. The 11ty documentation has thorough explainers for different bits of functionality that might come in useful when working on this website.

This project's template files are written in Nunjucks and Markdown. If you are using Visual Studio Code as your code editor when working on this project, we recommend that you install the following plugins:

Installation

  1. Clone repository: Start by cloning this repository to your local machine using Git:

    git clone https://github.com/thegreenwebfoundation/developer-docs

    If you plan to contribute to this project, then please create a fork of it in your own Github account before making changes.

  2. Navigate to project directory: Once the cloning process is complete, navigate to the project directory:

    cd developer-docs
  3. Install dependencies: Install the project dependencies using npm:

    npm install

    Alternatively, if you prefer using yarn:

    yarn install

Making Changes

  1. Edit markdown files: Make changes to the markdown (.md) files located in the src/docs folder to update the content as needed.

  2. Preview changes: After making your modifications, run the following command to preview the changes locally:

    npm run dev

    This will start a local development server, allowing you to view your changes in a web browser. You can now view your changes by visiting https://localhost:8080.

Using GitPod

Alternatively, you can open this project in GitPod for a hassle-free development experience.

Open in Gitpod

Contributing changes

To contribute changes back to this project, please follow the steps outlined in the CONTRIBUTING.md file in this repository.

By following these steps, you can seamlessly work on this site locally and contribute to improving our developer documentation.

developer-docs's People

Contributors

bhartik021 avatar evanhahn avatar fershad avatar hanopcan avatar jaybox325 avatar michael-voit avatar mrchrisadams avatar mulhoon avatar prajwalkulkarni avatar rossf7 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

developer-docs's Issues

Add a Click to Copy Button for Code Blocks in docs

Is your feature request related to a problem? Please describe:
It is important to have a "copy" button available on code blocks in the documentation. This will allow users to easily copy the entire code without accidentally leaving any important parts behind.

Describe the solution you'd like:
We will use JavaScript to implement the copy functionality throughout the complete documentation, allowing for a specific code block to be copied.

Steps to reproduce:

Screenshot:
image

Update SWD docs to make it clear what grid intensity is used when a data center is green

Related to thegreenwebfoundation/co2.js#197

When using the perByteTrace or perVisitTrace functions for the Sustainable Web Design model in CO2.js, the user can adjust the grid intensity used when calculating data center emissions. This is captured in https://github.com/thegreenwebfoundation/developer-docs/blob/main/src/docs/co2js/tutorials/customise-website-carbon-calculations.md

However, if the user passes in a value of true for the green parameter the grid intensity used for the data center is set to 50g CO2e/kWh (as per the Sustainable Web Design model).

The purpose of this issue is so that we can ensure we clearly highlight this in the docs.

Add type badges for options

Is your feature request related to a problem? Please describe.
Yep, it's tricky to know what is optional or not within the options object.

Describe the solution you'd like
Would like to extend the changing-variables

Describe alternatives you've considered
Could have the Optional badge like in other params

Screenshot 2023-08-03 at 18 45 41

Typos in contributor.md file

Describe the bug
There are a few small typos in the contributor.md file.

To Reproduce
Steps to reproduce the behavior:

  1. Go to CONTRIBUTING.MD file
  2. Have a read, you'll spot a few typos

Expected behavior
Ideally no typos!

Screenshots
n/a

Additional context
Add any other context about the problem here.

Error on API docs endpoint failing builds

The below fetch call to the Green Web Foundations Docs API endpoint is failing. As a result, websites builds also fail. Information from this API is used to generate content for some of the API related docs.

const data = await fetch('https://api.thegreenwebfoundation.org/api-docs/?format=openapi').then((res) => res.json());

Even after changing the endpoint to https://admin.thegreenwebfoundation.org/api-docs/?format=openapi the fetch request still fails with a server error 500. Hitting the URL above in a browser, though, returns valid JSON.

@mrchrisadams do you have any idea what might be going on?

Add "Edit on GitHub" link to pages

To allow for easier public contributions, an "Edit on GitHub" link can be added to the bottom of each page, or in the footer. This would link to the corresponding markdown file on the main branch.

An example of something similar:
image

Add documentation for Sustainable Web Design Model version 4 in CO2.js

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
An updated version of the Sustainable Web Design Model is being added to CO2.js in the next release (v0.16). This model will initially be available for developers to opt in to using, with the current version (version 3) remaining the default model used in CO2.js for the time being.

Updates to the documentation are required to show developers how to opt in to using the Version 4 methodology. There are no functionality changes from version 3 to version 4, however the results returned by the segment and perByteTrace and perVisitTrace functions do change to reflect the operation/embodied emissions breakdown in the newer version. This should also be shown to developers.

Additional context
Related PR merging SWDM v4 into CO2.js can be found at: thegreenwebfoundation/co2.js#208

Create "Community" Section on Website for Contributor Engagement

Is your feature request related to a problem? Please describe.

Yes, this feature request is related to enhancing contributor engagement and fostering a strong community on our website.

Describe the solution you'd like
I would like to propose creating a dedicated "Community" section on our website. This section will serve as a central hub for community members to connect, collaborate, and contribute effectively to our projects. It will include the following key features:

  • Community Guidelines: Clear guidelines for participation, respectful communication, and contributing to projects.

  • Contributor Resources: Links to project repositories, documentation, tutorials, and instructions for reporting issues and submitting contributions.

  • Events and Activities: Announcements and details about upcoming events, workshops, webinars, and opportunities for community engagement.

  • Recognition and Rewards: Features like a contributor hall of fame, spotlights on top contributors, and rewards programs for significant contributions.

  • Communication Channels: Information about communication platforms such as mailing lists, forums, chat platforms, and social media channels for community interaction.

  • Feedback Mechanisms: Surveys, feedback forms, and open discussions to gather input and suggestions from community members.

Describe alternatives you've considered

An alternative approach would be to integrate community features into existing sections of the website, such as incorporating community guidelines within the "About Us" page or listing collaboration opportunities under project descriptions. However, a dedicated "Community" section provides a more organized and comprehensive platform for community engagement.

Additional context

This feature request is aimed at improving the overall community experience on our website and fostering a sense of belonging and collaboration among contributors. We believe that a dedicated "Community" section will facilitate better communication, encourage active participation, and showcase the valuable contributions of our community members.

Add more args to `perVisit` docs

Is your feature request related to a problem? Please describe.
I thought I wanted to use perVisit to pass in carbon intensity. But couldn't see this as an option in the documentation. So had to check out the code to see if I could pass it in options

Describe the solution you'd like
Just a few more options on the documentation as per the code

  perVisit(
    bytes,
    carbonIntensity = false,
    segmentResults = false,
    options = {}
  ) {

Documentation for adding new docs/repos

Currently there is no proper documentation. To help others contribute, documentation is needed for:

  • Adding new documentation to an existing repository
  • Adding a new repository for documentation

Add anchor links to headings

To make it easier to link to specific sections of a page, it would be handy to have automatically generated id attributes added to each heading (in a slugified format). This could then be used for anchor links in other parts of the site.

Add image processing to build

Currently, images added to the site are not optimised and are served in their original format. This is not great for both performance and sustainability.

Image should be:

  • Converted to WEBP & AVIF formats.
  • Output at different sizes to server a variety of viewports.

To-do:

  • Use 11ty Image plugin to process images at build time.

Documentation: Add Vale linter for doc quality checks

Is your feature request related to a problem? Please describe.

The Vale Linter (natural language linter) implements spell check and other basic rules.

Describe the solution you'd like

1.Integrate a natural language linter like Vale into the documentation workflow.
2.Implement spell check and grammar rules to ensure consistent language usage across all documentation pages.
3.Define style libraries and extension points within the linter to enforce project-specific writing guidelines and conventions.
4.Configure the linter to check for common writing errors, improve readability, and suggest enhancements for technical content.
5.Provide guidelines and documentation on how contributors can use the linter during the documentation writing and review process.

Describe alternatives you've considered

N/A

Additional context

Benefits:

  1. Improved documentation quality with consistent spelling, grammar, and style.

  2. Enhanced readability and understanding of technical content for users and contributors.

  3. Facilitates collaboration by establishing clear writing standards and guidelines.

  4. Supports the long-term maintainability and scalability of the documentation.

Missing explainer for using other models/model versions in CO2.js tutorials

Describe the bug
Currently, the CO2.js tutorials only show how to perform actions using the default implementation (Sustainable Web Design Model v3). At the very least, it would be helpful to show how to run each tutorial using other models/versions - like OneByte and Sustainable Web Design Model v4.

To Reproduce
Steps to reproduce the behavior:

  1. Got to a CO2.js tutorial (e.g. https://developers.thegreenwebfoundation.org/co2js/tutorials/getting-started-browser/)
  2. Scroll to a code block showing CO2.js being used
  3. Notice that there is no mention of changing models, or alternate models/versions available.

Expected behavior
It would be good to allow users to interact with code blocks, and change the model or model version they wish to use. This can be reflected in the code example they're presented & persisted through the rest of the docs.

Screenshots
image

Extend documentation

Is your feature request related to a problem? Please describe.
There are lots of method names in the models that I find confusing. e.g perByteTrace and perVisitTrace within the customise-website-carbon-calculations pages.

Describe the solution you'd like
With each method, it should have a description e.g.

perByteTrace

This means that it....

perVisitTrace

This means that it....

Update README with Community and Contributing Information

Is your feature request related to a problem? Please describe.

The current documentation for contributors lacks clarity and detail, making it challenging for new contributors to understand how to get started with the project effectively. This can lead to confusion and delays in onboarding new contributors.

Describe the solution you'd like

I would like to improve the documentation for contributors by Updating a contributing.md file to the repository. This file will include detailed instructions on how to contribute to the project, such as setting up the development environment, creating pull requests, and following the project's coding standards and best practices.

Describe alternatives you've considered

An alternative solution would be to update the existing README.md file with the contribution guidelines. However, updating contributing.md file allows for better organization and clarity, making it easier for contributors to find the information they need.

Additional context

Having a contributing.md file is essential for welcoming new contributors and streamlining the contribution process. It ensures that all contributors have access to clear and comprehensive guidelines, leading to a more collaborative and productive development environment.

Update Eleventy & dependencies

As an first step for the Google Season of Docs project, we've identified that the version of 11ty and related dependencies in this project should be updated.

The current stable version of 11ty is 2.0.1, however it might be worth exploring updating to the latest Canary release 3.0.0-alpha.10 which support ESM syntax.

Current status for a stable 3.0 release can be found at: https://github.com/11ty/eleventy/milestone/40

A better content review flow for PRs

There should be a way to link from a deploy preview (in Cloudflare) back to the related PR. This would allow any reviewer to be able to quickly make text changes in the PR directly - rather than going back and forth in Trello/Notion.

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.