본문 바로가기
개발/팁&활용

티스토리에 자바(JAVA) 소스 올리기

by 용술이 2021. 5. 30.

 티스토리를 시작하다 보니 직업상 소스 등을 공유해야 할 일들이 생긴다. 

 

 티스토리 자체에서 제공하는 "코드블럭" 을 이용해도 되지만, 정말 안 이쁘게 나온다. 

다른 블러그들은 멋들어지던데... 하며 찾아보았다. 

 

 여러가지 방법들이 있었는데 그중에 나름 마음에 들었던 것이 바로

 

 Color Scripter (colorscripter.com/) 이다.

 

 다음은 코드 블록으로 만들었을 때의 모양이다. 

 

    @Test
    public void getProperties() {
        Properties properties = new Properties();
 
        try {
            properties.load(new FileInputStream("D:\\test\\src\\test\\java\\sample.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
 
        String url = properties.getProperty("url");
        System.out.println(url);
    }

 

깔끔하고 좋다. 

 

다음은 Color Scripter로 만들었을 때의 모양이다. 

1
2
3
4
5
6
7
8
9
10
11
12
13
    @Test
    public void getProperties() {
        Properties properties = new Properties();
 
        try {
            properties.load(new FileInputStream("D:\\test\\src\\test\\java\\sample.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
 
        String url = properties.getProperty("url");
        System.out.println(url);
    }
cs

 

번거롭긴 하지만 조금 더 스타일리시하다. 

 

사용하려고 하면 html과 script의 기본적인 모양을 알아야 할지도 모르겠다.

 

사용은 분명 사용자의 몫이지만, 이왕이면 좋은 게 좋은 거 아닐까? 

반응형

댓글