YARD를 사용하여 Ruby 코드를 문서화하고 야드를 가져 오는 데 문제가 있습니다 설명서 야드롬의yardoc의 HTML 출력에 표시 할 최상위 네임 스페이스의 일부 메서드에 대한 설명서를 만들었습니다.YARD를 사용하여 최상위 네임 스페이스의 메서드를 문서화
내 설명서는 @api
태그가 추가 된 lib/yard/globals.rb의 YARD 보석과 본질적으로 동일합니다. 제거하려고 시도했으나 --api
매개 변수없이 yardoc
을 실행했지만 문제가 해결되지 않았습니다.
#!/usr/bin/ruby
# @group PIP Negotiation: Backend and helper methods
#
# Deserializes a topology graph in YAML format into the database.
#
# @api pip-negotiate
# @param [String] graph A FleRD graph in YAML format
# @return [Boolean] status True if graph was deserialized successfully, False otherwise.
# @return [Integer] gl_id The database ID of the deserialized GraphLabel (nil if deserialization failed).
# @return [Array] output Standard output channel of flerd-deserialize.rb(1)
# @return [Array] output Standard error channel of flerd-deserialize.rb(1)
def insert_graph(graph)
return [ true, 1, ["1"], [""] ] # Not the actual method body.
end
# @endgroup
나는 HTML 문서 모두를 생성하는 yardoc
를 실행 처음 잘 보이는 :
이
은 예입니다% yardoc -o pip-negotiate --api pip-negotiate '**/*.rb'
Files: 1
Modules: 0 ( 0 undocumented)
Classes: 0 ( 0 undocumented)
Constants: 0 ( 0 undocumented)
Methods: 1 ( 0 undocumented)
100.00% documented
%
html로 비록 내 문서 중 하나를 포함하지 않는 생성 . 모두 에 포함되어 있으며 pip-negotiate
API 태그가 포함 된 메소드 목록이 있습니다. 여기 자신을 볼 수 있습니다 내가 대신 기대했던
http://btw23.de/tmp/pip-negotiate/api/method_list.html
더 최상위 방법에 대한 YARD 자신의 문서와 같은 것이었다 :
http://rubydoc.info/gems/yard/toplevel
아마도 특별한 마법이 있습니까 내 yardoc
호출에 누락되었습니다.
내 yardoc 루비 버전 1.8.7에서 실행 0.8.6.2이다 (2012-06-29 패치 레벨 370) x86_64에-리눅스]
코드를 링크하는 대신 문제가 발생하는 문제를 충분히 풀어 붙여 주시겠습니까? 질문을 개선하고 답변으로 인해 프로젝트 코드를 수정하면 관련성을 유지하십시오. 당신이 두 번째 링크를 가질 수있는 부작용. –
맞아, 나는 그 생각을 했어야했다 (고정 된). 감사! –
예제를 복사하여'yardoc -o pip-negotiate **/*. rb'가 올바른 것으로 보이는 것을 발견했습니다. '--api' 또는'--api pip-negotiate'를 추가하면 다시 깨지는 것처럼 보였습니다. 그러나 나는 아직 이해하지 못했거나 이유를 설명하지 못했습니다. 'yard 0.8.7.2' –