Programing

Markdown Syntax를 사용하여 인용구의 저자 인용

crosscheck 2020. 7. 10. 08:00
반응형

Markdown Syntax를 사용하여 인용구의 저자 인용


Symphony CMS를 사용하고 있으며 기사 작성에는 Markdown을 사용합니다. 벤자민 프랭클린 (Benjamin Franklin)이 인용 한 인용구를 인용해야하며, 인용문 다음에 인용문을 원합니다. 마크 다운 구문에서이 작업을 어떻게 수행합니까?


마크 다운에는 전용 인용 구문이 없습니다.

가장 좋은 방법은 다음과 같습니다.

> Quote here.
>
> -- <cite>Benjamin Franklin</cite>

결과 :

여기 인용하십시오.

- 벤자민 프랭클린


> The secret to creativity is knowing how to hide your sources. 
> -- <cite>[Albert Einstein][1]</cite>

[1]:http://www.quotedb.com/quotes/2112

스타일 매뉴얼이있는 경우, 지침을 사용하여 인용 위치 등을 정확하게 결정하십시오.

위의 마크 다운 + 순교자의 출력은

창의성의 비결은 출처를 숨기는 방법을 아는 것입니다. - 앨버트 아인슈타인


참조를 위해 여기에 다른 샘플을 추가하십시오. https://en.wikipedia.org/wiki/Special:CiteThisPage 에서 생성

> Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. 
>
> --- [Test-driven development. (2016, November 20). In Wikipedia, The Free Encyclopedia. Retrieved 23:45, November 20, 2016](https://en.wikipedia.org/w/index.php?title=Test-driven_development&oldid=750634597)

다음을 생성합니다.

TDD (Test-driven development)는 매우 짧은 개발주기의 반복에 의존하는 소프트웨어 개발 프로세스입니다. 요구 사항이 매우 특정한 테스트 사례로 전환 된 다음 새로운 테스트 만 통과하도록 소프트웨어가 개선됩니다.

--- 테스트 중심 개발. (2016 년 11 월 20 일). 위키 백과, 우리 모두의 백과 사전. 2016 년 11 월 20 일 23:45에 확인 함


1. 어떤 인용문이든 알 수없는 경우에도 출처가 있다고 가정합니다.

2. 마크 다운 > Quote<blockquote><p>Quote</p></blockquote>같이 렌더링되므로

> Quote1
>
> Quote2

로 렌더링

<blockquote>
  <p>Quote1</p>
  <p>Quote2</p>
</blockquote>

이것에 대한 나의 해결책은 항상 <p></p>소스로 마지막 가져 와서 CSS로 처리합니다 (내 경우에는 SCSS).

blockquote {
    p {
        display: inline;

        &:first-of-type {
            quotes: '\201C' '\201D' '\2018' '\2019';

            &::before {
                content: open-quote;
                margin-right: 0.1rem;
            }
        }

        &:last-of-type {
            quotes: '\201C' '\201D' '\2018' '\2019';
            font-style: italic;

            &::before {
                content: close-quote "\000A" "\2014" " ";
                white-space: pre;
                margin-left: 0.1rem;
                font-style: normal;
            }
        }

        // In case of a quote without a source.
        &:only-of-type {
            font-style: normal;
            quotes: '\201C' '\201D' '\2018' '\2019';

            &::before {
               content: open-quote;
               margin-right: 0.1rem;
            }

            &::after {
                content: close-quote;
                margin-left: 0.1rem;
            }
        }
    }
}

The \000A it the new line unicode character css format, it help to make the source in appear in the next line, if you don't want, just remove it and add some spaces there. The others are also unicode character css format.


Personally I prefer nesting a blockquote in a blockquote.

Here is how I like doing it:

> Quote here.
>
>> <cite>Benjamin Franklin</cite>

The output varies on how you style everything, but using plain `ol github look like this, which I personally think looks great!

enter image description here

https://gist.github.com/nahtnam/63e3a14acd0f02313ec0

참고URL : https://stackoverflow.com/questions/2002120/citing-the-author-of-a-blockquote-using-markdown-syntax

반응형