Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Insert element in the start or in the middle of a document

オープン
#7 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

まず、内部メソッド _insert_at と、issue で言及されているドキュメントのパース動作を読みます。既存のドキュメントのトリビアを最も適切に保持できるのが、公開挿入 API とドキュメントのクローン方式のどちらかを判断し、そのうえでメタデータを先頭または途中に挿入する場合の期待される動作を定義し、焦点を絞ったテストで検証します。

索引モデルが issue の本文から書いたものです。

説明

enhancement

I am wondering, would this be a feasible feature to implement? I dug into the code and saw there is an internal _insert_at method implemented; would it be a good idea to expose it as public?

My use case it there is an important metadata table in the document, but if it’s missing, I would like to put it at the very front so the user can be encouraged to fill it out. Appending it at the end makes it much less prominent, but there doesn’t seem to be a good way to “clone” a document with internal trivials intact either (or maybe this is what I actually need?).

I realise I can simply write to the TOML file directly, and re-parse the document again, but that feels more like a hack than a proper solution to me. Plus that approach would be suspect to race conditions IMO because the user may be editing it at the same time.

主要言語
Python
スター
850
フォーク
163
平均マージ
13分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-poetry/tomlkit のほかの issue

python-poetry/tomlkit の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。