2023-11-30
This commit is contained in:
parent
4ed84bcb4f
commit
0330e905e9
8 changed files with 28 additions and 31 deletions
|
@ -1,2 +1,2 @@
|
||||||
<noscript><div><img src="https://mc.yandex.ru/watch/91925585" style="position:absolute; left:-9999px;" alt=""></div></noscript>
|
<noscript><div><img src="https://mc.yandex.ru/watch/95699485" style="position:absolute; left:-9999px;" alt=""></div></noscript>
|
||||||
<!-- /Yandex.Metrika counter -->
|
<!-- /Yandex.Metrika counter -->
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
<!-- Google tag (gtag.js) -->
|
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-071GTXN2K2"></script>
|
|
||||||
<script>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
function gtag(){dataLayer.push(arguments);}
|
|
||||||
gtag('js', new Date());
|
|
||||||
gtag('config', 'G-071GTXN2K2');
|
|
||||||
</script>
|
|
||||||
<!-- Yandex.Metrika counter -->
|
<!-- Yandex.Metrika counter -->
|
||||||
<script>
|
<script>
|
||||||
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
||||||
m[i].l=1*new Date();for(var j=0;j<document.scripts.length;j++){if(document.scripts[j].src===r){return;}}
|
m[i].l=1*new Date();for(var j=0;j<document.scripts.length;j++){if(document.scripts[j].src===r){return;}}
|
||||||
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
||||||
(window,document,"script","https://mc.yandex.ru/metrika/tag.js","ym");
|
(window,document,"script","https://mc.yandex.ru/metrika/tag.js","ym");
|
||||||
ym(91925585,"init",{clickmap:true,trackLinks:true,accurateTrackBounce:true,webvisor:true});
|
ym(95699485,"init",{clickmap:true,trackLinks:true,accurateTrackBounce:true,webvisor:true});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -101,8 +101,8 @@ o o
|
||||||
|
|
||||||
We bypass the coordinate range with two nested `for` loops: first along the `y` axis and then along
|
We bypass the coordinate range with two nested `for` loops: first along the `y` axis and then along
|
||||||
the `x` axis. We check each point for compliance with the conditions and output it. In the upper part
|
the `x` axis. We check each point for compliance with the conditions and output it. In the upper part
|
||||||
we draw two half-circles and optionally paint over them inside/outside. In the lower part we draw a
|
we draw two half-circles and optionally paint over them inside and outside. In the lower part we draw
|
||||||
half-rhombus and also optionally paint over inside/outside.
|
a half-rhombus and also optionally paint over inside and outside.
|
||||||
|
|
||||||
```java
|
```java
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
title: Directory tree with links
|
title: Directory tree with links
|
||||||
description: We write a Bash script for building a directory tree for a repository in the Markdown file. We use only Bash tools and basic Linux software without additional.
|
description: We write a Bash script for building a directory tree for a repository in the Markdown file. We use only Bash tools and basic Linux software without additional.
|
||||||
sections: [Recursion,File processing,Web-navigation]
|
sections: [Recursion,File processing,Web-navigation]
|
||||||
tags: [linux,bash,markdown,html,folders,files,references,sorting]
|
tags: [linux,bash,markdown,html,structure,folders,files,references,sorting]
|
||||||
canonical_url: /en/2023/08/04/directory-tree.html
|
canonical_url: /en/2023/08/04/directory-tree.html
|
||||||
url_translated: /ru/2023/08/03/directory-tree.html
|
url_translated: /ru/2023/08/03/directory-tree.html
|
||||||
title_translated: Дерево каталогов со ссылками
|
title_translated: Дерево каталогов со ссылками
|
||||||
|
@ -17,9 +17,10 @@ the Markdown file. We use only Bash tools and basic Linux software — `ls`,
|
||||||
will be used in the web interface to navigate through the objects of the repository.
|
will be used in the web interface to navigate through the objects of the repository.
|
||||||
|
|
||||||
We create a recursive function and use it to bypass all files and directories of the repository,
|
We create a recursive function and use it to bypass all files and directories of the repository,
|
||||||
excluding the list from `.gitignore`. We output tree elements as links `<a>`, collapse folders
|
excluding the list from `.gitignore` — we build a directory structure in the form of a tree. We
|
||||||
with one nested element into one line, place the tree in the container `<pre>` and add the title
|
output the elements as links `<a>`, collapse folders with one nested element into one line, place
|
||||||
— as a result, we get a short and concise Markdown file with links.
|
the constructed tree in a container `<pre>` and add the title — as a result, we get a short and
|
||||||
|
concise Markdown file with links.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
|
@ -18,9 +18,10 @@ additional programs. The obtained file `DIRECTORY_TREE.md` will be used in the w
|
||||||
to navigate through the objects of the repository.
|
to navigate through the objects of the repository.
|
||||||
|
|
||||||
We create a recursive function and use it to bypass all files and directories of the repository,
|
We create a recursive function and use it to bypass all files and directories of the repository,
|
||||||
excluding the list from `.gitignore`. We output tree elements as links `<a>`, collapse folders
|
excluding the list from `.gitignore` — we build a directory structure in the form of a tree. We
|
||||||
with one nested element into one line, place the tree in the container `<pre>` and add the title
|
output the elements as links `<a>`, collapse folders with one nested element into one line, place
|
||||||
— as a result, we get a short and concise Markdown file with links.
|
the constructed tree in a container `<pre>` and add the title — as a result, we get a short and
|
||||||
|
concise Markdown file with links.
|
||||||
{%- endcapture %}
|
{%- endcapture %}
|
||||||
{%- assign articles = articles | push: article_brief %}
|
{%- assign articles = articles | push: article_brief %}
|
||||||
{%- assign articles = articles | push: "Password generator" %}
|
{%- assign articles = articles | push: "Password generator" %}
|
||||||
|
|
|
@ -97,9 +97,10 @@ o o
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
{%- include collapsed_block.html summary="Полный вывод" content=collapsed_md -%}
|
{%- include collapsed_block.html summary="Полный вывод" content=collapsed_md -%}
|
||||||
|
|
||||||
Обходим диапазон координат двумя вложенными циклами `for`: сначала по оси `y` и затем по оси `x`. Каждую
|
Обходим диапазон координат двумя вложенными циклами `for`: сначала по оси `y` и затем по оси `x`.
|
||||||
точку проверяем на соответствие условиям и выводим. В верхней части рисуем два полукруга и опционально
|
Каждую точку проверяем на соответствие условиям и выводим. В верхней части рисуем два полукруга и
|
||||||
закрашиваем их внутри/снаружи. В нижней части рисуем полуромб и также опционально закрашиваем внутри/снаружи.
|
опционально закрашиваем их внутри и снаружи. В нижней части рисуем полуромб и также опционально
|
||||||
|
закрашиваем внутри и снаружи.
|
||||||
|
|
||||||
```java
|
```java
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
title: Дерево каталогов со ссылками
|
title: Дерево каталогов со ссылками
|
||||||
description: Напишем скрипт Bash для построения дерева каталогов для репозитория в файле Markdown. Будем использовать только средства Bash и базовое ПО Linux без...
|
description: Напишем скрипт Bash для построения дерева каталогов для репозитория в файле Markdown. Будем использовать только средства Bash и базовое ПО Linux без...
|
||||||
sections: [Рекурсия,Обработка файлов,Вёб-навигация]
|
sections: [Рекурсия,Обработка файлов,Вёб-навигация]
|
||||||
tags: [linux,bash,markdown,html,каталоги,файлы,ссылки,сортировка]
|
tags: [linux,bash,markdown,html,структура,каталоги,файлы,ссылки,сортировка]
|
||||||
canonical_url: /ru/2023/08/03/directory-tree.html
|
canonical_url: /ru/2023/08/03/directory-tree.html
|
||||||
url_translated: /en/2023/08/04/directory-tree.html
|
url_translated: /en/2023/08/04/directory-tree.html
|
||||||
title_translated: Directory tree with links
|
title_translated: Directory tree with links
|
||||||
|
@ -15,10 +15,11 @@ date: 2023.08.03
|
||||||
[`DIRECTORY_TREE.md`]({{ site.homepage_url }} "{{ site.homepage_name }}")
|
[`DIRECTORY_TREE.md`]({{ site.homepage_url }} "{{ site.homepage_name }}")
|
||||||
будем использовать в вёб-интерфейсе для навигации по объектам репозитория.
|
будем использовать в вёб-интерфейсе для навигации по объектам репозитория.
|
||||||
|
|
||||||
Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория,
|
Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория, за
|
||||||
за исключением списка из `.gitignore`. Выводим элементы дерева в виде ссылок `<a>`,
|
исключением списка из `.gitignore` — строим структуру каталогов в форме дерева. Выводим
|
||||||
сворачиваем папки с одним вложенным элементом в одну строку, помещаем дерево в контейнер `<pre>`
|
элементы в виде ссылок `<a>`, сворачиваем папки с одним вложенным элементом в одну строку,
|
||||||
и добавляем заголовок — в результате получаем краткий и лаконичный файл Markdown со ссылками.
|
помещаем собранное дерево в контейнер `<pre>` и добавляем заголовок — в результате получаем
|
||||||
|
краткий и лаконичный файл Markdown со ссылками.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
|
@ -16,10 +16,11 @@ title_translated: Code with comments
|
||||||
— без дополнительных программ. Полученный файл `DIRECTORY_TREE.md` будем использовать
|
— без дополнительных программ. Полученный файл `DIRECTORY_TREE.md` будем использовать
|
||||||
в вёб-интерфейсе для навигации по объектам репозитория.
|
в вёб-интерфейсе для навигации по объектам репозитория.
|
||||||
|
|
||||||
Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория,
|
Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория, за
|
||||||
за исключением списка из `.gitignore`. Выводим элементы дерева в виде ссылок `<a>`,
|
исключением списка из `.gitignore` — строим структуру каталогов в форме дерева. Выводим
|
||||||
сворачиваем папки с одним вложенным элементом в одну строку, помещаем дерево в контейнер `<pre>`
|
элементы в виде ссылок `<a>`, сворачиваем папки с одним вложенным элементом в одну строку,
|
||||||
и добавляем заголовок — в результате получаем краткий и лаконичный файл Markdown со ссылками.
|
помещаем собранное дерево в контейнер `<pre>` и добавляем заголовок — в результате получаем
|
||||||
|
краткий и лаконичный файл Markdown со ссылками.
|
||||||
{%- endcapture %}
|
{%- endcapture %}
|
||||||
{%- assign articles = articles | push: article_brief %}
|
{%- assign articles = articles | push: article_brief %}
|
||||||
{%- assign articles = articles | push: "Генератор паролей" %}
|
{%- assign articles = articles | push: "Генератор паролей" %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue