Skip to content

Commit

Permalink
adding first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
parithosh committed Dec 2, 2024
1 parent 750eca6 commit 68733d7
Show file tree
Hide file tree
Showing 10 changed files with 363 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
1 change: 1 addition & 0 deletions docs/getting_started/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ethereum Client Team Docs
19 changes: 19 additions & 0 deletions docs/img/ETH-logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/Ethereum-logo-600px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/img/favicon.ico
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 29.1 50" style="enable-background:new 0 0 29.1 50;" xml:space="preserve">
<style type="text/css">
.st0{fill:#0DAFD2;}
.st1{fill:#667BBC;}
.st2{fill:#9E69AC;}
.st3{fill:#F58B77;}
.st4{fill:#FCEB67;}
.st5{fill:#54BC7A;}
</style>
<polygon class="st0" points="14.6,37.6 14.6,49.5 0,28.3 "/>
<polygon class="st1" points="29.1,28.3 14.6,49.5 14.6,37.6 "/>
<polygon class="st2" points="29.1,25.3 14.6,17 14.6,34.6 "/>
<polygon class="st3" points="29.1,25.3 14.6,0 14.6,17 "/>
<polygon class="st4" points="14.6,0 14.6,17 0,25.3 "/>
<polygon class="st5" points="14.6,17 14.6,34.6 0,25.3 "/>
</svg>
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
128 changes: 128 additions & 0 deletions docs/javascripts/site.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// Config
const FILTER_INPUT_SELECTOR = ".custom_dt_filter";
const FILTER_SEARCH_SELECTOR = "#custom_dt_search";
let table;
const ICON_COLUMN_FILTER =
'<span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 16.88c.56 0 1 .44 1 1s-.44 1-1 1-1-.45-1-1 .44-1 1-1m0-3c2.73 0 5.06 1.66 6 4-.94 2.34-3.27 4-6 4s-5.06-1.66-6-4c.94-2.34 3.27-4 6-4m0 1.5a2.5 2.5 0 0 0 0 5 2.5 2.5 0 0 0 0-5M18 3H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h5.42c-.16-.32-.3-.66-.42-1 .12-.34.26-.68.42-1H4v-4h6v2.97c.55-.86 1.23-1.6 2-2.21V13h1.15c1.16-.64 2.47-1 3.85-1 1.06 0 2.07.21 3 .59V5c0-1.1-.9-2-2-2m-8 8H4V7h6v4m8 0h-6V7h6v4Z"></path></svg></span>';

// This script is used both within mkdocs and in standalone html files.
// As such, a uniform listener to page load event is required.
// The snippet below uses mkdocs subscription if present otherwise jquery is used
// as a fallback.
// see: https://github.com/squidfunk/mkdocs-material/issues/5816#issuecomment-1667654560

if (typeof document$ == "undefined") {
document$ = {};
document$.subscribe = $(document).ready;
}

document$.subscribe(() => {
initDataTable();

if (table) {
// Listen for changes to filters
$(FILTER_INPUT_SELECTOR).on("change", filterRows);

$(FILTER_SEARCH_SELECTOR).on("input", filterRows);

// Apply preselected filters (if present) on page load
filterRows();

// Listen for copy event
listenForClipboardCopy();

// Style native dataTable buttons
$(".dt-buttons").detach().appendTo(".panel_row.filters");
$(".buttons-collection").prepend(ICON_COLUMN_FILTER);
}

// Setup up select 2
$(`select${FILTER_INPUT_SELECTOR}`).select2();
});

const initDataTable = () => {
// Only pages where a table is present.
if (!$("#test_table").length) return false;

// Setup DataTable plugin
// https://datatables.net/reference/api/
table = new DataTable("#test_table", {
pageLength: -1,
scrollX: true,
autoWidth: false,
layout: {
topStart: {
buttons: ["colvis"],
},
},
});
};

// A custom DataTable filter is implemented using a <select> tag with the following requirements:
// - It must have the `FILTER_INPUT_SELECTOR` class.
// - It must include a `data-criteria` attribute that specifies the criteria this filter looks for.
//
// Example:
// <select class="<FILTER_INPUT_SELECTOR>" data-criteria="fork"></select>
//
// The value of the `data-criteria' attribute must match the corresponding data attribute in the <tr> elements.
// For instance, rows containing <tr data-fork="..."> will be filtered based on this selection.
const filterRows = () => {
table
.rows()
.search(function (rowContent, b, index) {
const row = $(table.row(index).node());
let match = true;

const searchKeyword = $(FILTER_SEARCH_SELECTOR).val();
const searchHit = rowContent.includes(searchKeyword);

for (let filter of $(FILTER_INPUT_SELECTOR)) {
// Filter is ignored if set to all
if ($(filter).val() == "all") continue;

// Otherwise, the result of this filter applied to the previous match.
match =
match && row.data($(filter).data("criteria")) === $(filter).val();
}

return searchKeyword.length ? match && searchHit : match;
})
.draw();
};

const listenForClipboardCopy = () => {
// Event delegation for copy-to-clipboard functionality
document.addEventListener("click", function (event) {
if (event.target && event.target.classList.contains("copy-id")) {
const fullId = event.target.getAttribute("data-full-id");

// Copy to clipboard
navigator.clipboard
.writeText(fullId)
.then(() => {
const originalContent = event.target.innerHTML;

// Set the sliding message with animation
event.target.innerHTML =
'<span class="slide show">...full test id copied!</span>';

// Delay the hiding of the slide-out message
setTimeout(() => {
const slideElement = event.target.querySelector(".slide");
if (slideElement) {
slideElement.classList.add("hide");
}
}, 1000);

// Restore the original content after the animation
setTimeout(() => {
event.target.innerHTML = originalContent;
}, 1500); // Total duration before restoring original content
})
.catch((err) => {
console.error("Failed to copy text: ", err);
});
}
});
};
3 changes: 3 additions & 0 deletions docs/navigation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- markdownlint-disable MD007 MD041 (MD007=ul-indent MD041=first-line-heading) -->
* Getting Started
* [Overview](getting_started/overview.md)
91 changes: 91 additions & 0 deletions docs/stylesheets/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.slide {
display: inline-block;
position: relative;
opacity: 0;
left: 20px;
transition: all 0.5s ease;
}

.slide.show {
opacity: 1;
left: 0;
}

.slide.hide {
opacity: 0;
left: 20px;
}

/* Data table control panel */
.control_panel .search_wrapper input {
border: 1px solid #9e9e9e;
border-radius: 4px;
padding: 8px 15px;

font-size: 18px;
display: block;
width: 100%;
}
.control_panel .filters {
display: flex;
}

.control_panel .filters .filter_wrapper {
margin-right: 15px;
padding: 8px 14px;
border-radius: 4px;
vertical-align: middle;
border: 1px solid #9e9e9e;
margin-bottom: 10px;
}

.control_panel .filters .filter_wrapper label {
color: #8f8f8f;
font-weight: bold;
font-size: 14px;
}

.control_panel .select2-container--default .select2-selection--single {
border: none;
}

#test_table_wrapper .dt-search {
display: none;
}

.twemoji {
--md-icon-size: 1.125em;
display: inline-flex;
height: var(--md-icon-size);
vertical-align: text-top;
}

.twemoji svg {
fill: currentcolor;
max-height: 100%;
width: var(--md-icon-size);
}

.stand_alone_container {
margin: 10px 15px;
}

.control_panel .filters .buttons-collection,
.control_panel .filters .buttons-collection:hover {
background: transparent;
padding: 10px 15px;
vertical-align: middle;
border: 1px solid #9e9e9e;
margin-bottom: 10px;
}

.control_panel div.dt-buttons > .dt-button:hover:not(.disabled),
div.dt-buttons > div.dt-button-split .dt-button:hover:not(.disabled) {
background: transparent;
border: 1px solid #9e9e9e;
}

.buttons-collection .twemoji {
color: #8f8f8f;
margin-right: 4px;
}
56 changes: 56 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
site_name: Ethereum client team docs
site_description: A collection of docs from Ethereum client teams
site_url: https://eth-clients.github.io/docs/
repo_url: https://github.com/eth-clients/docs
repo_name: docs
edit_uri: edit/main/docs/
copyright: "Copyright: 2024, Ethereum Community"




theme:
name: material
logo: img/Ethereum-logo-600px.png
favicon: img/ETH-logo-icon.svg
language: en
features:
- content.code.copy
- search.suggest
- search.highlight
- content.tabs.link
- navigation.indexes
- navigation.instant
- navigation.tabs


markdown_extensions:
- abbr
- admonition
- attr_list
- def_list
- footnotes
- md_in_html
- toc:
permalink: true
toc_depth: 4


extra:
version:
provider: mike

extra_javascript:
- https://code.jquery.com/jquery-3.7.1.min.js
- https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js
- https://cdn.datatables.net/2.1.7/js/dataTables.min.js
- https://cdn.datatables.net/buttons/3.1.2/js/dataTables.buttons.js
- https://cdn.datatables.net/buttons/3.1.2/js/buttons.dataTables.js
- https://cdn.datatables.net/buttons/3.1.2/js/buttons.colVis.min.js
- javascripts/site.js

extra_css:
- https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css
- https://cdn.datatables.net/2.1.7/css/dataTables.dataTables.min.css
- https://cdn.datatables.net/buttons/3.1.2/css/buttons.dataTables.css
- stylesheets/custom.css

0 comments on commit 68733d7

Please sign in to comment.