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 -->
|
||||
|
|
|
@ -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 -->
|
||||
<script>
|
||||
(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;}}
|
||||
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");
|
||||
ym(91925585,"init",{clickmap:true,trackLinks:true,accurateTrackBounce:true,webvisor:true});
|
||||
ym(95699485,"init",{clickmap:true,trackLinks:true,accurateTrackBounce:true,webvisor:true});
|
||||
</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
|
||||
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
|
||||
half-rhombus and also optionally paint over inside/outside.
|
||||
we draw two half-circles and optionally paint over them inside and outside. In the lower part we draw
|
||||
a half-rhombus and also optionally paint over inside and outside.
|
||||
|
||||
```java
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
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.
|
||||
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
|
||||
url_translated: /ru/2023/08/03/directory-tree.html
|
||||
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.
|
||||
|
||||
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
|
||||
with one nested element into one line, place the tree in the container `<pre>` and add the title
|
||||
— as a result, we get a short and concise Markdown file with links.
|
||||
excluding the list from `.gitignore` — we build a directory structure in the form of a tree. We
|
||||
output the elements as links `<a>`, collapse folders with one nested element into one line, place
|
||||
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
|
||||
#!/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.
|
||||
|
||||
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
|
||||
with one nested element into one line, place the tree in the container `<pre>` and add the title
|
||||
— as a result, we get a short and concise Markdown file with links.
|
||||
excluding the list from `.gitignore` — we build a directory structure in the form of a tree. We
|
||||
output the elements as links `<a>`, collapse folders with one nested element into one line, place
|
||||
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 %}
|
||||
{%- assign articles = articles | push: article_brief %}
|
||||
{%- assign articles = articles | push: "Password generator" %}
|
||||
|
|
|
@ -97,9 +97,10 @@ o o
|
|||
{% endcapture %}
|
||||
{%- include collapsed_block.html summary="Полный вывод" content=collapsed_md -%}
|
||||
|
||||
Обходим диапазон координат двумя вложенными циклами `for`: сначала по оси `y` и затем по оси `x`. Каждую
|
||||
точку проверяем на соответствие условиям и выводим. В верхней части рисуем два полукруга и опционально
|
||||
закрашиваем их внутри/снаружи. В нижней части рисуем полуромб и также опционально закрашиваем внутри/снаружи.
|
||||
Обходим диапазон координат двумя вложенными циклами `for`: сначала по оси `y` и затем по оси `x`.
|
||||
Каждую точку проверяем на соответствие условиям и выводим. В верхней части рисуем два полукруга и
|
||||
опционально закрашиваем их внутри и снаружи. В нижней части рисуем полуромб и также опционально
|
||||
закрашиваем внутри и снаружи.
|
||||
|
||||
```java
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
title: Дерево каталогов со ссылками
|
||||
description: Напишем скрипт Bash для построения дерева каталогов для репозитория в файле Markdown. Будем использовать только средства Bash и базовое ПО Linux без...
|
||||
sections: [Рекурсия,Обработка файлов,Вёб-навигация]
|
||||
tags: [linux,bash,markdown,html,каталоги,файлы,ссылки,сортировка]
|
||||
tags: [linux,bash,markdown,html,структура,каталоги,файлы,ссылки,сортировка]
|
||||
canonical_url: /ru/2023/08/03/directory-tree.html
|
||||
url_translated: /en/2023/08/04/directory-tree.html
|
||||
title_translated: Directory tree with links
|
||||
|
@ -15,10 +15,11 @@ date: 2023.08.03
|
|||
[`DIRECTORY_TREE.md`]({{ site.homepage_url }} "{{ site.homepage_name }}")
|
||||
будем использовать в вёб-интерфейсе для навигации по объектам репозитория.
|
||||
|
||||
Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория,
|
||||
за исключением списка из `.gitignore`. Выводим элементы дерева в виде ссылок `<a>`,
|
||||
сворачиваем папки с одним вложенным элементом в одну строку, помещаем дерево в контейнер `<pre>`
|
||||
и добавляем заголовок — в результате получаем краткий и лаконичный файл Markdown со ссылками.
|
||||
Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория, за
|
||||
исключением списка из `.gitignore` — строим структуру каталогов в форме дерева. Выводим
|
||||
элементы в виде ссылок `<a>`, сворачиваем папки с одним вложенным элементом в одну строку,
|
||||
помещаем собранное дерево в контейнер `<pre>` и добавляем заголовок — в результате получаем
|
||||
краткий и лаконичный файл Markdown со ссылками.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
|
|
@ -16,10 +16,11 @@ title_translated: Code with comments
|
|||
— без дополнительных программ. Полученный файл `DIRECTORY_TREE.md` будем использовать
|
||||
в вёб-интерфейсе для навигации по объектам репозитория.
|
||||
|
||||
Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория,
|
||||
за исключением списка из `.gitignore`. Выводим элементы дерева в виде ссылок `<a>`,
|
||||
сворачиваем папки с одним вложенным элементом в одну строку, помещаем дерево в контейнер `<pre>`
|
||||
и добавляем заголовок — в результате получаем краткий и лаконичный файл Markdown со ссылками.
|
||||
Создаём рекурсивную функцию и с её помощью обходим все файлы и каталоги репозитория, за
|
||||
исключением списка из `.gitignore` — строим структуру каталогов в форме дерева. Выводим
|
||||
элементы в виде ссылок `<a>`, сворачиваем папки с одним вложенным элементом в одну строку,
|
||||
помещаем собранное дерево в контейнер `<pre>` и добавляем заголовок — в результате получаем
|
||||
краткий и лаконичный файл Markdown со ссылками.
|
||||
{%- endcapture %}
|
||||
{%- assign articles = articles | push: article_brief %}
|
||||
{%- assign articles = articles | push: "Генератор паролей" %}
|
||||
|
|
Loading…
Add table
Reference in a new issue