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

publish: upload local files referenced by links, not just images

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
cli

調査の方向性

images.go:78 の forward attachment registration から始め、次に attachname.go と共有されている withinRoot clamp を読みます。リンクの処理を renderImage と比較し、docs/confluence/links-and-anchors.md のマッピングを確認します。条件を満たすローカルの .md 以外のリンク先が正しくアップロードおよび書き換えされ、.md リンクでは既存のページ URL の動作が維持され、逆方向の ri:attachment レンダリングが sourceFor 経由で更新されれば完了です。

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

説明

enhancement

read/export now pass an attachment link through as raw storage rather than converting it, because a markdown link to the exported file would break on the next publish. From the mapping table in links-and-anchors.md:

storage markdown why
ri:attachment passthrough only images are uploaded, so [x](Deck.ppt) would publish as a dead relative href

So this exports:

Grab <ac:link><ri:attachment ri:filename="Deck.ppt" /><ac:plain-text-link-body>the deck</ac:plain-text-link-body></ac:link>.

where Grab [the deck](Deck.ppt). would read better, preview locally, and reference the file export already downloads (it scans raw storage for ri:filename, not just ac:image, precisely so a link target is included).

What blocks it is the forward path, not the inverse one. Only images.go:78 registers an Attachment, so a local file named by a link destination is never uploaded, and republishing [the deck](Deck.ppt) emits <a href="Deck.ppt"> — a relative href that resolves to nothing on Confluence, with no warning and exit 0. That is the silent failure mode docs/confluence/links-and-anchors.md already calls out for unresolved doc links, and it is worse here because the link was working before the round trip.

The work is therefore in the forward direction first: treat a link destination that names a local non-.md file the way an image src is treated — resolve it page-relative, clamp it to the documentation root, register it as an attachment, and rewrite the href to the attachment. attachname.go's source-path↔attachment-name codec and the withinRoot clamp both already exist and are shared with images; what is missing is a link-side caller. Once a link target uploads, flip ri:attachment in the inverse mapping from passthrough to [body](path) via sourceFor, exactly as renderImage does.

Two things to decide when picking this up. Whether a link to a local file should upload it at all, or only when some marker says so — an unqualified rule means any [x](notes.txt) in a repo starts publishing that file as an attachment, which may be more than anyone asked for. And what .md siblings do, which must keep resolving to page URLs via the existing doc-link path rather than becoming attachments.

Split out of #88, where the passthrough decision was made.

主要言語
Go
スター
2
フォーク
0
平均マージ
2時間 50分
マージ済み PR(30日)
52

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

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

はじめの一歩

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

mozilla/markfluence のほかの issue

mozilla/markfluence の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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