perldoc-jp / perldoc.jp

https://perldoc.jp のソース
https://perldoc.jp/
10 stars 2 forks source link

最新の翻訳の取込みとサイト更新 ( script/update_deployment.sh ) を main branch のpushにフックして、走らせる #48

Open kfly8 opened 10 months ago

kfly8 commented 10 months ago

TODO

script/update_deployment.sh で走ってる次の5つの処理を消しても良い状態にすれば、このissueは終わらせられそう。

kfly8 commented 10 months ago

現状確認

1. PJP::M::Index::Article->generate_and_save

このスクリプトは、こんな感じの indexデータを生成している ```shell head -50 index-article.pl [ { 'repository' => 'translation', 'versions' => [], 'distvname' => 'github.com/Perl/PPCs/ppcs/ppc0004-defer-block.md', 'latest_version' => 0, 'abstract' => 'この文書は、Perl/PPCs/ppcs/ppc0004-defer-blockを翻訳したものです。', 'name' => ' Perl/PPCs/ppcs/ppc0004 defer block ' }, { 'abstract' => 'Jesse SheidlowerさんによるCatalystチュートリアル。2005年のものなので、古いですが。', 'latest_version' => 0, 'name' => 'Catalyst - Perl.com', 'repository' => 'translation', 'distvname' => 'www.perl.com/pub/2005/06/02/catalyst.html', 'versions' => [] },
</details>

- このindexは、次のページで目次として利用されている。 https://perldoc.jp/index/article
- 集計をしている狙いは、キャッシュ。
  - ファイル、ディレクトリを都度舐めたくないからあるよう。
  - あとファイルの中身を見て、タイトルとか抜き出してそう。

###  2. PJP::M::Index::Module->generate_and_save

<details><summary>このスクリプトは、こんな感じの indexデータを生成している</summary>

```shell
head -50 index-module.pl
[
  {
    'name' => 'Acme-Bleach',
    'abstract' => "Perl\x{306e}\x{5224}\x{308a}\x{306b}\x{304f}\x{3044}\x{6f14}\x{7b97}\x{5b50}\x{3092}\x{7c21}\x{5358}\x{306b}\x{3057}\x{307e}\x{3059}",
    'latest_version' => undef,
    'versions' => [
      {
        'name' => 'Acme-Bleach',
        'abstract' => "Perl\x{306e}\x{5224}\x{308a}\x{306b}\x{304f}\x{3044}\x{6f14}\x{7b97}\x{5b50}\x{3092}\x{7c21}\x{5358}\x{306b}\x{3057}\x{307e}\x{3059}",
        'distvname' => 'Acme-Bleach-1.12',
        'repository' => 'translation',
        'version' => '1.12'
      },
      {
        'abstract' => "Perl\x{306e}\x{5224}\x{308a}\x{306b}\x{304f}\x{3044}\x{6f14}\x{7b97}\x{5b50}\x{3092}\x{7c21}\x{5358}\x{306b}\x{3057}\x{307e}\x{3059}",
        'name' => 'Acme-Bleach',
        'version' => '1.12',
        'distvname' => 'Acme-Bleach-1.12',
        'repository' => 'perldoc.jp'
      }
    ],
    'repository' => 'translation'
  },
  {
    'abstract' => "perl\x{30b3}\x{30fc}\x{30c9}\x{306b}\x{57cb}\x{3081}\x{8fbc}\x{307e}\x{308c}\x{305f}Brainfuck",
    'latest_version' => undef,
    'name' => 'Acme-Brainfuck',
    'versions' => [
      {
        'abstract' => "perl\x{30b3}\x{30fc}\x{30c9}\x{306b}\x{57cb}\x{3081}\x{8fbc}\x{307e}\x{308c}\x{305f}Brainfuck",
        'name' => 'Acme-Brainfuck',
        'version' => '1.1.1',
        'repository' => 'translation',
        'distvname' => 'Acme-Brainfuck-1.1.1'
      },
      {
        'version' => '1.1.1',
        'repository' => 'perldoc.jp',
        'distvname' => 'Acme-Brainfuck-1.1.1',
        'abstract' => "perl\x{30b3}\x{30fc}\x{30c9}\x{306b}\x{57cb}\x{3081}\x{8fbc}\x{307e}\x{308c}\x{305f}Brainfuck",
        'name' => 'Acme-Brainfuck'
      }
    ],
    'repository' => 'translation'
  },

3. PJP::M::BuiltinFunction->generate($pjp);

4. PJP::M::BuiltinVariable->generate($pjp);

5. PJP::M::PodFile->generate($pjp);

kfly8 commented 10 months ago

素朴な疑問