Doxygen(/ˈdɒksiən/ DOK-see-jən)[3]도큐멘테이션 생성기이자[4][5][6][7] 소프트웨어 참조 설명문을 작성하기 위한 도구이다. 여기서 설명문은 코드 내에 작성되므로 상대적으로 최신화 상태를 유지하기가 용이한 편이다. Doxygen은 설명문과 코드를 상호 참조할 수 있으며 문서의 독자는 쉽게 실제 코드를 참조할 수 있다.

Doxygen
개발자Dimitri van Heesch
발표일1997년 10월 26일(26년 전)(1997-10-26)[1]
안정화 버전
1.9.3[2] / 2021년 1월 8일(3년 전)(2021-01-08)
저장소
프로그래밍 언어C++
운영 체제크로스 플랫폼
종류도큐멘테이션 생성기
라이선스GNU GPLv2
웹사이트www.doxygen.nl

Doxygen은 GNU 일반 공중 사용 허가서 버전 2(GPLv2)로 배포되는 자유 소프트웨어이다.


예시 코드 편집

설명문의 주석의 일반 문법은 '/*'를 사용하는 것이다.

/**
<A short one line description>

<Longer description>
<May span multiple lines or paragraphs as needed>

@param  Description of method's or function's input parameter
@param  ...
@return Description of the return value
*/

수많은 프로그래머들은 각 줄의 시작을 공백-별표-공백으로 표기하는 것을 선호하지만 필수는 아니다.

/**
 * <A short one line description>
 *
 * <Longer description>
 * <May span multiple lines or paragraphs as needed>
 *
 * @param  Description of method's or function's input parameter
 * @param  ...
 * @return Description of the return value
 */

수많은 프로그래머들은 C 스타일 주석을 회피하며 그 대신 C++ 스타일 단일 라인 주석을 사용한다. Doxygen은 추가 슬래시로 주석 처리를 하는 것을 수용한다.

/// <A short one line description>
///
/// <Longer description>
/// <May span multiple lines or paragraphs as needed>
///
/// @param  Description of method's or function's input parameter
/// @param  ...
/// @return Description of the return value

다음은 C++ 소스 파일이 어떻게 문서화되는지를 설명한다.

 
출력이 HTML로 어떻게 표시되는지를 나타낸 스크린샷
/**
 * @file
 * @author  John Doe <jdoe@example.com>
 * @version 1.0
 *
 * @section LICENSE
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * https://www.gnu.org/copyleft/gpl.html
 *
 * @section DESCRIPTION
 *
 * The time class represents a moment of time.
 */

class Time {

    public:

       /**
        * Constructor that sets the time to a given value.
        *
        * @param timemillis is a number of milliseconds
        *        passed since Jan 1, 1970.
        */
       Time (int timemillis) {
           // the code
       }

       /**
        * Get the current time.
        *
        * @return A time object set to the current time.
        */
       static Time now () {
           // the code
       }
};

변수를 문서화하기 위한 또다른 접근법은 아래와 같다. 동일한 문서 내용을 출력한다.

       /**
        * Constructor that sets the time to a given value.
        */
       Time (int timemillis ///< Number of milliseconds passed since Jan 1, 1970.>
            )
       {
           // the code
       }

더 상위의 리치 마크업도 가능하다. LaTeX 명령을 이용한 예:

/**
 *
 * An inline equation @f$ e^{\pi i}+1 = 0 @f$
 *
 * A displayed equation: @f[ e^{\pi i}+1 = 0 @f]
 *
 */

Doxygen 소스와 개발 편집

Doxygen 소스는 현재 깃허브에서 호스팅되고 있으며 여기서 주 개발자 Dimitri van Heesch는 "doxygen"이라는 사용자 이름으로 기여하고 있다.[8] Doxygen은 C++로 작성되었으며 300,000개 이상의 소스 라인으로 구성되어 있다. 낱말 분석의 경우 표준 도구 lex(또는 대안이 되는 Flex)는 35,000개의 lex 스크립트 줄로 동작한다. 구문 분석 도구 Yacc(또는 대안이 되는 Bison)도 사용되지만 사소한 작업에만 쓰이며 언어 구문 분석 중 상당 부분은 네이티브 C++ 코드로 수행된다. 빌드 프로세스CMake에 기반을 두며 일부 파이썬 스크립트를 수반한다.

같이 보기 편집

각주 편집

  1. ANNOUNCE: doxygen 0.1 보관됨 10월 4, 2011 - 웨이백 머신, Announcing: the first release of Doxygen, a C++ documentation system. , From: Dimitri van Heesch, Date: Sun, 26 Oct 1997, Qt-interest Archive
  2. “Doxygen Manual: Changelog”. 《www.doxygen.nl》. 
  3. FAQ: How did doxygen get its name?
  4. Perkel, Jeffrey M. (2015년 11월 22일). “Get With the Program: DIY tips for adding coding to your analysis arsenal”. 《The Scientist》 (Journal). The Scientist. 
  5. Sabin, Mihaela (2015년 11월 22일). “Doxygen”. 《OpenComputing》 (위키). University of New Hampshire. 2015년 11월 23일에 원본 문서에서 보존된 문서. 
  6. “Doxygen”. 《Free Software Directory》 (위키). 2015년 11월 22일. 
  7. “Documentation”. 《en:Rosetta Code》 (위키). 2015년 11월 22일. 
  8. https://github.com/doxygen/doxygen

외부 링크 편집